Dear Logan,
For me to compare both the bitmap can I not do something like this?
The screen bitmap are captured like this
Previously saved bitmap
g_prevBitmap= WinGetBitmap(winH);
Current screen
currBitmap = WinGetBitmap(winH);
BmpGetSizes(currBitmap, &dataSize, &headerSize);
const BYTE * pOldImage = (const BYTE *)BmpGetBits(currBitmap);
const BYTE * pNewImage = (const BYTE *)BmpGetBits(g_prevBitmap);
for (I = 0; I < dataSize; ++I)
{
if (*(pOldImage + I) != *(pNewImage + I))
return true;//They have changed so
return
}
Pls let me know your comments on this
Regards,
Venkat.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Aryeh
Teitelbaum
Sent: Monday, December 20, 2004 8:19 PM
To: Palm Developer Forum
Subject: Re: Bitmap
Thanks Logan.
I used the rowBytes in place of the width and it works !!
Aryeh
----- Original Message -----
From: "Logan Shaw" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[email protected]>
Sent: Thursday, December 16, 2004 8:12 AM
Subject: Re: Bitmap
> [EMAIL PROTECTED] wrote:
> > 1. I know we can request the current screen and get them saved to a
> > bitmap ,this is for full screen but can I request for only part of
the
> > screen by specifying the co-ordinates?
>
> If you just want to save if, use WinSaveBits(). It takes a
> RectangleType pointer as an argument.
>
> > Is it possible to with any direct
> > API s that are available or how this can be done?
> >
> > 2.I want to compare a saved bitmap with another bitmap, any fast and
> > straight way to do this???
>
> Haven't done it, but you should be able to do this:
>
> Create both bitmaps yourself with BmpRsrcCreate(). Make them both
> the same format. 16-bit should be good, but you may also want to
> key off the screen format if they are both coming from the screen.
>
> Then use WinCreateBitmapWindow() to turn them both into a window.
> Copy from wherever (such as the draw window) to the bitmaps using
> WinCopyRectangle().
>
> Now, to compare them, you can access the internals of the bitmap
> since you have use BmpRsrcCreate() to create them and know that
> they are not in some weird system format. So, use BmpGetBits()
> to get a pointer to the pixel data and BmpGetDimensions() to
> find out the bytes per row, then use your knowledge of the pixel
> format (since you specified it when creating the bitmap) to
> compare the relevant bytes on each row. You could just MemCmp()
> the whole entire pixel data, but there is no guarantee that there
> aren't unused bytes (or at least bits) between rows that might
> be filled with random garbage. (In other words, rowbytes doesn't
> necessarily equal 2 * bitmapwidth for all 16-bit bitmaps, and
> it certainly doesn't equal bitmapwidth / 2 for all 4-bit bitmaps,
> especially if bitmapwidth is an odd number!)
>
> - Logan
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/
Confidentiality Notice
The information contained in this electronic message and any attachments to
this message are intended
for the exclusive use of the addressee(s) and may contain confidential or
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL
PROTECTED] immediately
and destroy all copies of this message and any attachments.
--
For information on using the Palm Developer Forums, or to unsubscribe, please
see http://www.palmos.com/dev/support/forums/