Deepak.MA wrote:
I have a requirement wherein i need to have inverted(180 degree shift)
in the text that is rendered on the screen.
Is this possible at all???
Just to be clear, I assume you mean rotated 180 degrees around the
axis perpendicular to the screen.
I don't think Palm OS does it, by default, but you can get the effect in
one of two ways:
1. Make a font with characters that are rotated 180 degrees. Reverse
the characters in the strings you want to draw (harder if you use
multi-byte character encoding), then draw.
For extra cleverness points, write a function that takes an existing
font and converts it to the 180-degree-rotate version of itself.
2. Go get the BitmapRsrc sample code from the PalmSource knowledgebase.
Write a function to rotate the pixels in a BitmapRsrc bitmap by
180 degrees. With 8-bit and 16-bit bitmaps, this is easy. Lower
bit depths are trickier, but still possible to do fast if you're
clever with bit manipulation (and you might use a lookup table).
Then, when you want to draw text, create a BitmapRsrc bitmap of the
appropriate size, wrap it into a Window by using WinCreateBitmapWindow(),
draw into it, reverse it, and then WinCopyRectangle() it to the screen.
If you need to supprt transparent text, WinCopyRectangle() the existing
data from the draw window to the bitmap window, then rotate it, then
draw the text with transparency, then rotate it again, then draw it
back to the screen.
With method #2, it might actually be sufficient to just always work in
16-bit mode. Converting from 8-bit to 16-bit and back should produce
the right results, but it might be really slow.
- Logan
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/