Printing BMP in Xamarin without SDK

E Efkan YILMAZ 3 years 7 months ago
9 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

E Efkan YILMAZ

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?