There should be a rule that says you shouldn't post to newsgroups after 9:00
pm...
2048 corresponds to the 11th bit which is right where the red value picks
up.
Nice to know that my code works...
-Robert
-----Original Message-----
Subject: problems creating bitmaps...
From: Robert Matthews <[EMAIL PROTECTED]>
Date: Fri, 5 Oct 2001 06:15:31 -0000
X-Message-Number: 58
I'm having a really strange problem. I create a 160x20 bitmap using
BmpCreate and I just want to fill the pixels with 16 bit values starting at
1
and working my way up. For some reason when I get to a certain point (2048
pixels) it seems to reset and start over with the pixel values. I realize
that this is a poor explination, but look at it in POSE... ;} It's the 13th
line, 32 pixels from the end. Any help that anyone can give would be
greatly
appreciated. I can't figure out why this happens...why would it work right
up until the 2048th pixel...any why would it act like it starts over again?
Is the bitmap data area not a bunch of pixel values stacked together?
Here is the code that I'm using...nothing to fancy:
void ProcessImage() {
int pixelNum;
UInt16 pixelValue = 0;
UInt16 err;
UInt16 imageArray[160], bitsSize;
BitmapType * newBitmapP;
UInt8 * theBitsP, * theEndP, * theLineP;
void * fooP;
newBitmapP = BmpCreate( 160, 20, 16, NULL, &err );
bitsSize = BmpBitsSize( newBitmapP );
theBitsP = BmpGetBits( newBitmapP );
theEndP = theBitsP + bitsSize;
fooP = imageArray;
while ( theBitsP < theEndP ) {
testP = fooP;
for( pixelNum = 0; pixelNum < 160; pixelNum++ ) {
imageArray[pixelNum] = pixelValue++;
}
theLineP = theBitsP + 320;
while( theBitsP < theLineP ) {
*theBitsP++ = *testP++;
}
}
WinDrawBitmap( newBitmapP, 0, 0 );
}
}
Thanks in advance,
-Robert
----------------------------------------------------------------------
Subject: Non-Rectangular Imagemaps
From: "Stan Hunter" <[EMAIL PROTECTED]>
Date: Fri, 5 Oct 2001 03:00:09 -0400
X-Message-Number: 59
I'm looking for general advice on how to tackle the imagemap task.
The functional requirement for a Palm app I'm working on involves
imagemapping over photographic images. For instance, the Palm could show a
full-color bitmap of a room, and I'd want to make an imagemap that would
know when you tapped on any piece of furnature in the picture. Random
objects in a photograph are very non-rectangular shapes, too, and that adds
complexity.
I'll have all of the images at compile time and I'm brainstorming ways to do
this. I'm thinking of storing polygons in a Palm database, and if a user
taps inside a polygon, the program would know what object in the picture the
tap belonged to. I'd like to make sure this is not
wasteful of the Palm device's resources. I'm sure some methods for
imagemapping lend themselves to more efficient algorithms. Another
consideration is
how easy it would be for me to populate the database of polygons or
whatever. There could end up being a lot of rather complicated shapes to
imagemap.
Any ideas for implementing imagemaps of this sort would be very helpful.
Thanks,
Stan
[EMAIL PROTECTED]
---
END OF DIGEST
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/