Page 1 of 1

PostPosted: Sat Feb 17, 2001 1:41 am
by iebnn
I'm working on a more advanced and easier to use program that will convert bitmaps to hex.
I'm having trouble with getting the hex to come out right (as I'm not quite sure exactly how the bitmap format works in pocketc).
Could someone post something that would tell me how I would program something to find out the hex for the bitmap? I'm a bit confused about the four pixels thing. I got it to convert to hex properly, but it has the hex value for every pixel, not the hex value for four pixels combined (if I'm approaching this properly). Thanks

PostPosted: Sat Feb 24, 2001 7:18 am
by wossname
Quite simple, if you know how hex/binary work.

Bitmap(20,30,"018");

this above line of code draws a single dot on the screen at the co-ords (20,30).

the string that is used as the last argument is a hex string, the first 2 digits define the width of your bitmap in pixels, thus "01" is one pixel wide. As you will know, each hex character takes the place of 4 binary bits therefore the leftmost of those 4 bits is worth 8 in the binary system.

so a square of dots 3x3 printed at the same coordimates would be drawn as...

bitmap(20,30,"03F78");

<font face=Courier New>
XXX --> first 3 bits of "F"
X X --> last bit of "F" and first 2 bits of 7
XXX --> last 2 bits of 7 and first bit of 8, the last 3 bits of 8 are white</font id=Courier New>

Okay?

Wossname :)

PostPosted: Tue Feb 27, 2001 8:10 pm
by iebnn
hmm looks pretty simple
I'll try coding it and if I can't get it to work I'll post the algorithm here and maybe ya could give me some help? :)

PostPosted: Wed Feb 28, 2001 5:47 pm
by wossname
sure, just email me, wossnamex@talk21.com

Wossname :)