I noticed a missing Alphschannel using :
PalBmpDraw( hDC, 0, 0, oImg:hBitmap, , aRect[4] )
( needed, to calculate a new Image-size )
No Problem using :
REDEFINE IMAGE oIMG1 OF oDlg FILENAME cImage1 ;
ID 110 PIXEL ADJUST BORDER
REDEFINE IMAGE oIMG1 OF oDlg FILENAME cImage1 ;
ID 110 PIXEL ADJUST BORDER
oIMG1:cTooltip := "Original"
oIMG1:bPainted := { |hDC| ( DRAW_IMG(oIMG1, hDC, cImage1 ), oSay3:Refresh() ) }
// Needed to calculate Image-size, if original size or adjusted to Resource !!!
FUNCTION DRAW_IMG( oImage, hDC, cImage )
LOCAL oImg, aRect[4]
aRect := GETCLIENTRECT( oImage:hWnd )
IF FILE( cImage )
DEFINE IMAGE oImg FILENAME cImage
// Image resized to Resource-size
IF oImg:nWidth > aRect[4] .and. oImg:nHeight > aRect[3]
PalBmpDraw( hDC, 0, 0, oImg:hBitmap, , aRect[4], aRect[3] )
ENDIF
// Original-size can be used
IF oImg:nWidth < aRect[4] .and. oImg:nHeight < aRect[3]
PalBmpDraw( hDC, 0, 0, oImg:hBitmap )
ENDIF
...
...
Tested with a original FWH-sample < Imgtest.prg >
Alphablended BMP not sopported
- Code: Select all Expand view
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oWnd
LOCAL hBmp
DEFINE WINDOW oWnd
hBmp = READBITMAP( 0, ".\bitmaps\logo2.bmp" )
ACTIVATE WINDOW oWnd;
ON PAINT SFONDO( oWnd, hDC, hBmp );
MAXIMIZED
IF hBmp != 0; DELETEOBJECT( hBmp ); ENDIF
RETURN NIL
// -------------
STATIC FUNCTION SFONDO( oWnd, hDC, hBmp )
LOCAL nTop := 0
LOCAL nLeft := 0
LOCAL nWidth := oWnd:nWidth()
LOCAL nHeight := oWnd:nHeight()
IF hBmp = 0; RETURN NIL; ENDIF
PALBMPDRAW( hDC, nTop, nLeft, hBmp, , nWidth, nHeight )
RETURN NIL
Is there still something missing ?
Best Regards
Uwe