Xamarin LinkOS - printing an Android.Graphics.Bitmap object

When using the Xamarin LinkOS sdk to store an Android.Graphics.Bitmap object for later printing, are there any requirements as to the format or type of Bitmap?  The reason I'm asking is that when I go to print the bitmap, all I get is a solid black rectangle where the bitmap should be.

 

The bitmap is generated by the Xamarin signature capture component, it is being stored on the device using the StoreImage call on a scaled copy of the bitmap, and is being printed by a ^XG statement.  The rest of the label prints without issue, and a static logo on the label also prints fine.  It is only the signature capture bitmap that is causing headaches - all I get there is black rectangle.

 

Any suggestions would be greatly appreciated.

-David

Bryan Sanchez
I think you should use .png

I think you should use .png or .jpeg and not use high resolution to prevent an out memory exception. See early post, i have plenty of question where i post the code i am using to print. Especially this:

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


David Mikesell
Bryan,In the post you

Bryan,

In the post you referred to, it sounds like the solution was to do a reset of the printer.  I will try that, but could you also describe how you created the image.grf file?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Bryan Sanchez
See the attached files in

See the attached files in that post, i posted the code i use to print. These are the steps i do:

1 - Create the bitmap you wanna print-

2 - Send the bitmap to the printer "image.grf"

3 - Print the "image.grf"

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


David Mikesell
Thanks Brian.  Step 1 was


Thanks Brian.  Step 1 was where I was running into problems, but your code put me on the right path. 

Interestingly, when using a bitmap image directly created by the signature capture control didn't work, but using the ViewGroup from the signature capture control in combination with your code did the trick.

Thank you very much for your help!

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments