Hi All,
I am currently implementing a drawing program that captures pen movement in
a gadget, then the gadget data is converted to a bitmap. I then transfer
that data over an Inet call to a server. All of that is working fine, but it
is taking about 5 seconds. I'd like to speed this up.
What I do is this, capture pen movements, when done convert to a bitmap and
save to a db for future use if needed. Then (since I dont know anything
about palm bit maps) I am grabbing the data from the gadget one pixel at a
time and building a string representation of the gadget data ... for example
bufferH=MemHandleNew(10000);
bufferP=MemHandleLock(bufferH);
for(y=0;y<=yMax;y++)
for(x=0lx<=xMax;x++)
bitval=Wingetpixel(x,y);
if(bitval==1){
*(bufferP+idx++)="1";
else
*(bufferP+idx++)="0";
//about every hundreth write I make sure that the string isn't going
to go over
}
}
I end up with about a 10,000 character string, I then compress it with a my
own RLE compression algo. THen send it over the air via my INET calls. That
takes too much time. Any one have any ideas as to how I can reduce the time
to do all this? Better yet, can I somehow interpret the bitmap data directly
rather than dealing with the gadget data?
--
--
Brian Brackeen
[EMAIL PROTECTED]
"Clones are people two ... "
http://www.vbcoder.com
Phone: 972.877.8611
Fax: 877.540.6349
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/