PDA

View Full Version : Strange case with TransparentBlt


MiToNiOeS
25th May 2009, 02:43 PM
hello, i have a strange problem with TransparentBlt

I have a program writed on C++ and i need paint (in double buffer) the background image and a image with mask color (RGB(255,0,255) (Pink)) in each frame.
to paint i do this:
1º BitBlt: HDC with background image -> buffer HDC
2º TransparentBlt: HDC scene with transparent areas in pink color -> buffer HDC
3º BitBlt: Buffer HDC -> Display HDC

My applications its a custom today and it need to repaint very fast (http://forum.xda-developers.com/showthread.php?p=3831016) for nice animations but i have this problem:

If i attach my today in Settings/Today -> Today animations are slow
If i restart my device with today active -> Today animations are very fast!!! (so with BitBlt)
If i restart (i have fast animations) and i open Settings/Today and push OK buttom -> Today animations change to slow


If i change my code the line TransparentBlt for BitBlt the animations are fast always

Why with TransparentBlt the animations are fast when i do softreset only¿?¿?¿?¿?

I'm confused, can not understand why this happens...

l3v5y
25th May 2009, 07:59 PM
hello, i have a strange problem with TransparentBlt

I have a program writed on C++ and i need paint (in double buffer) the background image and a image with mask color (RGB(255,0,255) (Pink)) in each frame.
to paint i do this:
1º BitBlt: HDC with background image -> buffer HDC
2º TransparentBlt: HDC scene with transparent areas in pink color -> buffer HDC
3º BitBlt: Buffer HDC -> Display HDC

My applications its a custom today and it need to repaint very fast (http://forum.xda-developers.com/showthread.php?p=3831016) for nice animations but i have this problem:

If i attach my today in Settings/Today -> Today animations are slow
If i restart my device with today active -> Today animations are very fast!!! (so with BitBlt)
If i restart (i have fast animations) and i open Settings/Today and push OK buttom -> Today animations change to slow


If i change my code the line TransparentBlt for BitBlt the animations are fast always

Why with TransparentBlt the animations are fast when i do softreset only¿?¿?¿?¿?

I'm confused, can not understand why this happens...

TransparentBlts are slow generally...

Can you get away with TransparentBlting whatever you need onto a DC with the background at the start, and then BitBlting that onto the final DC.

That saves you having to TransparentBlt every time you redraw the screen, but you can still get transparency...

MiToNiOeS
25th May 2009, 08:48 PM
TransparentBlts are slow generally...

Can you get away with TransparentBlting whatever you need onto a DC with the background at the start, and then BitBlting that onto the final DC.

That saves you having to TransparentBlt every time you redraw the screen, but you can still get transparency...

its possible that i dont undestand you because i dont speak english very well... can you expain me a bit more?

i have 2 DC, one with background and other with my scene, how to paint my scene into background without transparentblts?
i cant paint the components of my scene directly to a DC with background because to paint all components each frame is slow

l3v5y
25th May 2009, 08:54 PM
its possible that i dont undestand you because i dont speak english very well... can you expain me a bit more?

i have 2 DC, one with background and other with my scene, how to paint my scene into background without transparentblts?
i cant paint the components of my scene directly to a DC with background because to paint all components each frame is slow

How often do things need to change? Can you only repaint the regions that change (InvalidateRect(hWnd,&rWnd,false) will only repaint the rectangle rWnd, rather than the whole window).

MiToNiOeS
25th May 2009, 11:38 PM
How often do things need to change? Can you only repaint the regions that change (InvalidateRect(hWnd,&rWnd,false) will only repaint the rectangle rWnd, rather than the whole window).

i have that repaint the complete scene in each frame :(