12-19-2012 08:05 AM
It is possible to paint a Label onto a Bitmap, then rotate the bitmap too.
The easiest way to paint some text onto a Bitmap is to create the Bitmap, then grab the Graphics context for that Bitmap, and just use the standard
methods to create the Bitmap. Then you can rotate the Bitmap.
The critical parts are:
a) Create a Bitmap using new Bitmap(..). You will need to figure out what size to make it
b) Get the Graphics context using Graphics.create(..)
c) drawtext - you will need to be careful about positioning
d) Rotate. You could use this:
but it is probably simpler to just create a new Bitmap and use getARGB and setARGB to move the pixels.
Then you put the Bitmap in a BitmapField and it will look like a rotated label.
And just to confirm, you can not rotate any Field in the BlackBerry UI.
What you might have been able to do with the links I got you to search for, was create your own LabelField that wrote with rotated text. This is certainly possible and possibly a little more convenient than what I have suggested above. But it appears you are struggling to get the idea of this. There is a lot to learn to do this, for example, you will need to be able to create your own custom Field. So I think the above is the best option for you.
12-19-2012 09:00 AM - edited 12-19-2012 09:01 AM
Override its paint() method.
Override layout(int,int) (because you need different amount of hor/vert space than the original LabelField)
Override getPreferredWidth/Height to help container managers