I use a bitmap with a white pixel in 0,0. But when i use oBitmap:ltransparent := .T. all the white pixels are black and not transparent! Any solution?
I use a bitmap with a white pixel in 0,0. But when i use oBitmap:ltransparent := .T. all the white pixels are black and not transparent! Any solution?
Hello Günther,
have a look at my new post for a solution.
Regards
Uwe ![]()
&
I think bitmaps are transparent according to the first pixel without using lTransparent. Have you tried this?
Regards,
James
Hello James,
Günther said, he wants to use the BMP inside a WINDOW !!! .
The solution with a frame works inside a Object like a xBrowse-cell.
For a Window it is => ABPaint( hDC, 20, 20, oBmp:hBitmap, 220 ).
If he wants to use just a normal BMP, he has to convert it at first ( define transparent areas ).
I'm not shure, how and where he wants to use the Bitmap.
Regards
Uwe ![]()
Ulli, only to paint a BMP on the main-window with a colored background. In the BMP there are a white region with a logo in blue. The left-top-pixel are also white. But no transparence are reachable.
nOldClr = SetBkColor( ::hDC, nRGB( 255, 255, 255 ) )
TransBmp( ::hBitmap, ::nWidth(), ::nHeight(), nZeroZeroClr, ::hDC,;
::nX, ::nY, Super:nWidth(), Super:nHeight() )
SetBkColor( ::hDC, nOldClr )
Günther,
is it a MDI window or a non MDI window ?

Antonio, thanks, i will try tomorrow. I see, that i use no the call refresh().
Can the clausula TRANSPARENT to better handling not include in the @ 5,5 BITMAP/IMAGE and in REDEFINE BITMAP/IMAGE?






...
...
DEFINE BITMAP oBmp1 FILENAME "Volksbank.bmp"
ACTIVATE WINDOW oWnd MAXIMIZED ;
ON PAINT ( gradpaint( hDC, oWnd ), ;
ABPaint( hDC, 50, 50, oBmp:hBitmap, 220 ) )
RETURN NIL
// -----------------------------------------------
STATIC FUNTION gradpaint( hDC, oWnd )
local aGrad := { { 0.50, 16054371, 11892819 } }
GradientFill( hDC, 0, 0, oWnd:nHeight, oWnd:nWidth, aGrad, .F. )
RETURN NILUwe, thanks for your help. Its functioning perfect! But regardless the normal way to display transparent bitmaps on windows should be possible -> ANTONIO ![]()
Günther,
I posted a working example, maybe it was not working on your side as you use white for the windows background color (?)
You could try to change the background of your bitmap from white to another color and test my code again ![]()