On 12/9/06, Christian Giordano <[EMAIL PROTECTED]> wrote:
1) the application on the simulator have a different result than on the mobile. A part the color, that can be due to the fact that the simulator has a kind of system palette, on the mobile byteSize doesn't reach all the pixels of the screen, neither headerSize+bytesSize (this is weird!).
you need to call WinScreenMode() to set the depth you want. this can be 1,2,4,8 (palette) or 16bit (direct 565). by default; you may be in 8bpp (256 colors); or, in 16bit - where two bytes are used to represent a single pixel. i suggest you read up on color spaces and raster graphics. http://en.wikipedia.org/wiki/Color_space http://en.wikipedia.org/wiki/Raster_graphics this gives you some basic background - reality is that we mainly use an RGB based color model - which, is well defined here: http://en.wikipedia.org/wiki/RGB_color_model in regards to the image format itself? indexed: http://en.wikipedia.org/wiki/Indexed_color http://en.wikipedia.org/wiki/Palette_%28computing%29 direct color: http://en.wikipedia.org/wiki/Highcolour http://en.wikipedia.org/wiki/Truecolor if your curious how all the types of color spaces/palettes that have been used across computing history; this article will inform you of everything you need to know: http://en.wikipedia.org/wiki/List_of_palettes
2) with operation like: bitmapData[i] = bitmapData[i] * alpha; the performances falls consistently. About this and considering that I have ONLY to make the screen darker, I'm wondering if the most performant way would be to change the application palette, or something similar, so I don't have to pass and make calculations for all the pixels.
int * float = expensive operation. have you considered using an integer instead? effectively; makeBmpDarker(.., 1); bitmapData[i] = bitmapData[i] * alpha; is the same as: makeBmpDarker(.., 100); bitmapData[i] = bitmapData[i] / 100; this should speed it up. by the way; if your looking for a functional example of using 8bit graphics on the palmos; you can go to: http://www.ardiri.com/palm/cube3d/ http://www.ardiri.com/palm/burning/ where there is source code that can show you everything you need to have setup and how to access the bits of an image directly. its from 1999; but the code isn't really much out of date yet. -- // Aaron Ardiri Palm OS Certified Developer -- For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
