mCore™ .NET SMS Library 1.2

PictureSMS.BitmapFile Property

Description:

The BitmapFile property gets or sets the bitmap file to send as Picture SMS. The bitmap file resolution should be maximum 255 x 255 pixels and should be in multiples of 8.

mCore Picture SMS supports bitmap filetypes bmp, jpg, jpeg, jpe, jfif, gif, png, tif and tiff.

Picture SMS can send only monochrome bitmaps (8-bit depth), therefore if you specify a coloured bitmap file for sending, mCore will convert it into a monochrome bitmap internally (without changing the original file) before sending it.

Namespace: mCore
Assembly: mCoreLib (in mCoreLib.dll)

Exceptions:

mCore.PictureSMSException
mCore.GeneralException

Usage Example:

Visual Basic

Public Class MyClass
   Public WithEvents objSMS As New mCore.SMS

   Public Sub SendPictureSMS()
      Dim objPicSMS As mCore.PictureSMS = objSMS.PictureSMS
      Try
         SetCommParameters()

         objPicSMS.Destination = "+919873094767"
         objPicSMS.BitmapFile = "C:\birthday.bmp"
         objPicSMS.Text = "Happy Birthday"

         'Send the vCard
         objPicSMS.Send()
         MsgBox("Picture SMS Sent!", MsgBoxStyle.Information, strMyAppName)

      Catch ex As mCore.PictureSMSException
         MsgBox(ex.Message, MsgBoxStyle.Critical, "mCore Demo")
      Catch ex As mCore.GeneralException
         MsgBox(ex.Message, MsgBoxStyle.Critical, "mCore Demo")
      Catch ex As Exception
      End Try
   End Sub

   Public Sub SetCommParameters()
      Try
         objSMS.Port = "COM1"
         objSMS.BaudRate = mCore.BaudRate.BaudRate_19200
         objSMS.DataBits = mCore.DataBits.Eight
         objSMS.StopBits = mCore.StopBits.One
         objSMS.Parity = mCore.Parity.None
         objSMS.FlowControl = mCore.FlowControl.RTS_CTS

      Catch ex As mCore.GeneralException
         MsgBox(ex.Message)
      Catch ex As Exception
      End Try
   End Function
End Class

 
C#
class MyClass
{
   public mCore.SMS objSMS = new mCore.SMS();

   public static void SendVCard()
   {
      mCore.PictureSMS objPicSMS = objSMS.PictureSMS();
      try
      {

          SetCommParameters();

         objPicSMS.Destination = "+919873094767";
         objPicSMS.BitmapFile = "C:\\birthday.bmp";
         objPicSMS.Text = "Happy Birthday";

         'Send the vCard
         objPicSMS.Send();
         MessageBox.Show("Picture SMS Sent!");
      }

      catch (mCore.PictureSMSException e)
      {
         MessageBox.Show(e.ToString());
      }

      catch (mCore.GeneralException e)
      {
         MessageBox.Show(e.ToString());
      }
      catch (Exception e)
      {
      }
   }

   public static void SetCommParameters()
   {
      try
      {
         objSMS.Port = "COM1";
         objSMS.BaudRate = mCore.BaudRate.BaudRate_19200;
         objSMS.DataBits = mCore.DataBits.Eight;
         objSMS.StopBits = mCore.StopBits.One;
         objSMS.Parity = mCore.Parity.None;
         objSMS.FlowControl = mCore.FlowControl.RTS_CTS;
      }
      catch (mCore.GeneralException e)
      {
         MessageBox.Show(e.ToString());
      }
      catch (Exception e)
      {
      }
   }
}

See Also:

mCore.SMS.PictureSMS Method
PictureSMS.Text Property
PictureSMS.Destination Property
PictureSMS.Send Method

 

Copyright © IG Logix Softech Pvt Ltd, All Rights Reserved