tags:

views:

354

answers:

2

Hi Guys,

This question is related to BREW framework which used in CDMA phones. But I think this topic is also related in general memory buffer for graphics.

I just want to ask is how can I write a string using IDISPLAY_DrawText in a current bitmap buffer? This bitmap buffer is used by the IDISPLAY_BitBlt to draw the whole image in the screen. My problem is if I use the IDISPLAY_DrawText, the string will not draw, because there is always a IDISPLAY_Bitblt to draw the updated bitmap buffer.

Thanks alot guys.

+1  A: 

I don't know BREW, so I will try and answer the generic question, if I understood it correctly.
In general, you draw on an off-screen buffer, or even several ones. That's where you do your DrawText calls. If you have several buffers, you combine them in a general buffer of the size of the screen. Then, on screen update, BitBlt draws this general buffer on the screen buffer. Or if hardware allows it, it just swaps the buffers. That's classical double buffering.

If I answer beside your question, maybe you need to provide more information. Unless somebody knowing BREW understood it and answers it better than me! :-)

PhiLho
Yup mate, you explain it very well. Actually my problem is how can I put the text using DrawText in the offscreen buffer that the bitblt will use. Thanks
sasayins
+1  A: 

IFONT_DrawText can be used to draw directly into a bitmap. You can then blend/copy this bitmap however you want.

However, most of the time the IDisplay bitmap itself is already offscreen and only copied to the screen when IDISPLAY_Update/IDISPLAY_UpdateEx is called. So your offscreen buffer may be redundant...

The IFONT interface is defined in AEEFont.h in the BREW SDK 2.x and later. It also contains functions for measuring the size of the text, which may help with layout.

watsonmw