Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

Hello all,

I am having trouble making a white rectangle transparent using IDISPALY_DrawText(). I have created a clipping rectangle in a specefic location to draw the text inside of that clipping rectangle. The color of the clipping rectangle is white by default; I guess. The text is black. Everything works fine ...except, the text is not transparent using IDF_TEXT_TRANSPARENT flag. :( I mean the text is in a white rectangle but my intension is to make the white rectangle transparent.

The code:

void CVideoObject::CProgCtl_FitText(IDisplay * pd, IStatic * ps, AEEFont font, AECHAR * pszText)
{
AEERect rect;

rect.x = 103;
rect.y = 180;
rect.dx = 70;
rect.dy = 12;

IDISPLAY_SetClipRect(m_pIDisplay, &rect);
IDISPLAY_ClearScreen(m_pIDisplay);
IDISPLAY_DrawText(m_pIDisplay, font, pszText, -1, rect.x, rect.y, &rect, IDF_TEXT_TRANSPARENT);
IDISPLAY_Update(m_pIDisplay);
IDISPLAY_SetClipRect(m_pIDisplay, NULL);//This function refreshes the whole screen
}

It seems that IDF_TEXT_TRANSPARENT does not work properly. I am using LG VX 8100. Can anybody shed some lights on it?

I also have searched in the forum but the above preocess seems to be the only way to make text transparent on top of a background image. But..no luck in my case. I think I am missing a very important step...Please help.. :confused:

Thanks.

Hi,
Anybody??? BREW support???

Hi,
Anybody??? BREW support???

Hi Farhana,
Why do you want to make the rectangle transparent. if it is because the text is
not visible then use IDISPLAY_SetColor(); to make the color of the text to be any
other color other than white. then the text should be visible or if there is any
specific reason for the same please do let me know.
Regards,
Paresh

Hi Farhana,
Why do you want to make the rectangle transparent. if it is because the text is
not visible then use IDISPLAY_SetColor(); to make the color of the text to be any
other color other than white. then the text should be visible or if there is any
specific reason for the same please do let me know.
Regards,
Paresh

paresh wrote:Hi Farhana,
Why do you want to make the rectangle transparent. if it is because the text is
not visible then use IDISPLAY_SetColor(); to make the color of the text to be any
other color other than white. then the text should be visible or if there is any
specific reason for the same please do let me know.
Regards,
Paresh
Hello,
I have made a timer for a progress bar in my media application. There is a key control pad in the screen like D-pad which is used to pause/resume/stop control of the video. Now the D-pad is in the bottom middle part of the screen. The progress bar is below that. The timer is above the progress bar and right side of the D-Pad. Now, when the timer is showing for the progress, the timer text is drawn in a white rectangle. The white rectangle is overlapping the circular D-pad which I am trying to get rid of. The timer text color is fine. But the timer rectangle need to be transparent for this purpose. I hope I could make a sense here.
Pls let me know. It would be a great help.
Thanks in advance.

paresh wrote:Hi Farhana,
Why do you want to make the rectangle transparent. if it is because the text is
not visible then use IDISPLAY_SetColor(); to make the color of the text to be any
other color other than white. then the text should be visible or if there is any
specific reason for the same please do let me know.
Regards,
Paresh
Hello,
I have made a timer for a progress bar in my media application. There is a key control pad in the screen like D-pad which is used to pause/resume/stop control of the video. Now the D-pad is in the bottom middle part of the screen. The progress bar is below that. The timer is above the progress bar and right side of the D-Pad. Now, when the timer is showing for the progress, the timer text is drawn in a white rectangle. The white rectangle is overlapping the circular D-pad which I am trying to get rid of. The timer text color is fine. But the timer rectangle need to be transparent for this purpose. I hope I could make a sense here.
Pls let me know. It would be a great help.
Thanks in advance.

farhana wrote:
IDISPLAY_SetClipRect(m_pIDisplay, &rect);
IDISPLAY_ClearScreen(m_pIDisplay);
The above code will fill the clipping rectangle with the background color (possible white).
Quote:
IDISPLAY_DrawText(m_pIDisplay, font, pszText, -1, rect.x, rect.y, &rect, IDF_TEXT_TRANSPARENT);
IDISPLAY_Update(m_pIDisplay);
This will draw tranparent text on top of the rectangle drawn by IDISPLAY_ClearScreen().

farhana wrote:
IDISPLAY_SetClipRect(m_pIDisplay, &rect);
IDISPLAY_ClearScreen(m_pIDisplay);
The above code will fill the clipping rectangle with the background color (possible white).
Quote:
IDISPLAY_DrawText(m_pIDisplay, font, pszText, -1, rect.x, rect.y, &rect, IDF_TEXT_TRANSPARENT);
IDISPLAY_Update(m_pIDisplay);
This will draw tranparent text on top of the rectangle drawn by IDISPLAY_ClearScreen().

markb wrote:The above code will fill the clipping rectangle with the background color (possible white).
This will draw tranparent text on top of the rectangle drawn by IDISPLAY_ClearScreen().
Thanks a lot . I think my code is written excatly in this order. But the transparency is not wroking as logically it should do. Could you plesae take a look on this ?
my code:
void CVideoObject::CProgCtl_FitText(IDisplay * pd, IStatic * ps, AEEFont font, AECHAR * pszText)
{
AEERect rect;
rect.x = 103;
rect.y = 180;
rect.dx = 70;
rect.dy = 12;
IDISPLAY_SetClipRect(m_pIDisplay, &rect);
IDISPLAY_ClearScreen(m_pIDisplay);
IDISPLAY_DrawText(m_pIDisplay, font, pszText, -1, rect.x, rect.y, &rect, IDF_ALIGN_RIGHT |IDF_TEXT_TRANSPARENT);
IDISPLAY_Update(m_pIDisplay);
IDISPLAY_SetClipRect(m_pIDisplay, NULL);//This function refreshes the whole screen

This is why I am at a loss. It should work, but it is not really on the device. :confused:
Please help!

markb wrote:The above code will fill the clipping rectangle with the background color (possible white).
This will draw tranparent text on top of the rectangle drawn by IDISPLAY_ClearScreen().
Thanks a lot . I think my code is written excatly in this order. But the transparency is not wroking as logically it should do. Could you plesae take a look on this ?
my code:
void CVideoObject::CProgCtl_FitText(IDisplay * pd, IStatic * ps, AEEFont font, AECHAR * pszText)
{
AEERect rect;
rect.x = 103;
rect.y = 180;
rect.dx = 70;
rect.dy = 12;
IDISPLAY_SetClipRect(m_pIDisplay, &rect);
IDISPLAY_ClearScreen(m_pIDisplay);
IDISPLAY_DrawText(m_pIDisplay, font, pszText, -1, rect.x, rect.y, &rect, IDF_ALIGN_RIGHT |IDF_TEXT_TRANSPARENT);
IDISPLAY_Update(m_pIDisplay);
IDISPLAY_SetClipRect(m_pIDisplay, NULL);//This function refreshes the whole screen

This is why I am at a loss. It should work, but it is not really on the device. :confused:
Please help!

What are you expecting to see? Drawing a white rectangle and then transparent text on top of it is equivalent to drawing non-transparent text with a white background.

What are you expecting to see? Drawing a white rectangle and then transparent text on top of it is equivalent to drawing non-transparent text with a white background.

markb wrote:What are you expecting to see? Drawing a white rectangle and then transparent text on top of it is equivalent to drawing non-transparent text with a white background.
Hi,
I am really verry sorry for the confusion. Actually, I am erxpecting to see a transparent clipping rectangle with a black text on it. What I mean is text should not be transparent but the clipping rectangle should be transparent. So is there any way to do it using IDISPLAY-DrawText()?
Thanks for reading my problem and trying to solve it.

markb wrote:What are you expecting to see? Drawing a white rectangle and then transparent text on top of it is equivalent to drawing non-transparent text with a white background.
Hi,
I am really verry sorry for the confusion. Actually, I am erxpecting to see a transparent clipping rectangle with a black text on it. What I mean is text should not be transparent but the clipping rectangle should be transparent. So is there any way to do it using IDISPLAY-DrawText()?
Thanks for reading my problem and trying to solve it.

I'm still not sure what you mean by "transparent clipping rectangle". IDF_TEXT_TRANSPARENT means only the foreground-colored pixels will be drawn, and the background pixels will be left as-is.
The point I was trying to make in my first post was that you are explicitly filling in the clipping rectangle when you call IDISPLAY_ClearScreen(), so it's not going to make any difference whether you use IDF_TEXT_TRANSPARENT. The net result is the same either way.
Try it without calling ClearScreen().

I'm still not sure what you mean by "transparent clipping rectangle". IDF_TEXT_TRANSPARENT means only the foreground-colored pixels will be drawn, and the background pixels will be left as-is.
The point I was trying to make in my first post was that you are explicitly filling in the clipping rectangle when you call IDISPLAY_ClearScreen(), so it's not going to make any difference whether you use IDF_TEXT_TRANSPARENT. The net result is the same either way.
Try it without calling ClearScreen().

markb wrote:I'm still not sure what you mean by "transparent clipping rectangle". IDF_TEXT_TRANSPARENT means only the foreground-colored pixels will be drawn, and the background pixels will be left as-is.
The point I was trying to make in my first post was that you are explicitly filling in the clipping rectangle when you call IDISPLAY_ClearScreen(), so it's not going to make any difference whether you use IDF_TEXT_TRANSPARENT. The net result is the same either way.
Try it without calling ClearScreen().
Thanks Markb.
I will try your way.

markb wrote:I'm still not sure what you mean by "transparent clipping rectangle". IDF_TEXT_TRANSPARENT means only the foreground-colored pixels will be drawn, and the background pixels will be left as-is.
The point I was trying to make in my first post was that you are explicitly filling in the clipping rectangle when you call IDISPLAY_ClearScreen(), so it's not going to make any difference whether you use IDF_TEXT_TRANSPARENT. The net result is the same either way.
Try it without calling ClearScreen().
Thanks Markb.
I will try your way.

markb wrote:I'm still not sure what you mean by "transparent clipping rectangle". IDF_TEXT_TRANSPARENT means only the foreground-colored pixels will be drawn, and the background pixels will be left as-is.
The point I was trying to make in my first post was that you are explicitly filling in the clipping rectangle when you call IDISPLAY_ClearScreen(), so it's not going to make any difference whether you use IDF_TEXT_TRANSPARENT. The net result is the same either way.
Try it without calling ClearScreen().
I have fixed the problem :D . It seems that I have to draw the background image everytime the timer is updated. Also calling or not calling IDISPLAY_ClearScreen() doesn't make any difference in this case
Thanks everybody for helping :)

markb wrote:I'm still not sure what you mean by "transparent clipping rectangle". IDF_TEXT_TRANSPARENT means only the foreground-colored pixels will be drawn, and the background pixels will be left as-is.
The point I was trying to make in my first post was that you are explicitly filling in the clipping rectangle when you call IDISPLAY_ClearScreen(), so it's not going to make any difference whether you use IDF_TEXT_TRANSPARENT. The net result is the same either way.
Try it without calling ClearScreen().
I have fixed the problem :D . It seems that I have to draw the background image everytime the timer is updated. Also calling or not calling IDISPLAY_ClearScreen() doesn't make any difference in this case
Thanks everybody for helping :)