Printing BMP in Xamarin without SDK

V Vedsatx Saddvv 2 years 10 months ago
7 1 0

I am able to print text in my Xamarin.Android app with no issue, but have no clue on where to start on printing a BMP.  The app captures a signature in PNG format.  I take this and convert it to a BMP, but am lost as to what to do next.  Could someone help complete the code
 
void PrintSignature(object sender, EventArgs e)
        {
 
            OutputStream sOut;
            BluetoothSocket s;
            BA.CancelDiscovery();
 
            string addy = "";
            BufferedWriter outReader = null;
 
            try
            {
         
                var pairedprinters = BA.BondedDevices;
                foreach (var device in pairedprinters) { addy = device.Address; }
                BluetoothDevice BD = BA.GetRemoteDevice(addy);
 
                s = BD.CreateInsecureRfcommSocketToServiceRecord(SerialPortServiceClass_UUID);
                if (!s.IsConnected)
                {
                    s.Connect();
                    System.Threading.Thread.Sleep(3000); //

Please register or login to post a reply

1 Replies

V Vedsatx Saddvv

Hi Kevin, I think I have it.  There may be a more elegant solution, but this should get you there.

void PrintSignature(object sender, EventArgs e)
        {

            OutputStream sOut;
            BluetoothSocket s;
            BA.CancelDiscovery();

            string addy = "";
            BufferedWriter outReader = null;

            try
            {
       
                var pairedprinters = BA.BondedDevices;
                foreach (var device in pairedprinters) { addy = device.Address; }
                BluetoothDevice BD = BA.GetRemoteDevice(addy);

                s = BD.CreateInsecureRfcommSocketToServiceRecord(SerialPortServiceClass_UUID);
                if (!s.IsConnected)
                {
                    s.Connect();
                    System.Threading.Thread.Sleep(3000); //

CONTACT
Can’t find what you’re looking for?