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); //
Printing BMP in Xamarin without SDK |
1 Replies
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); //