I tested all Options for Dialogs.
The Result : Say on Image- and Gradient-Background not transparent.
Maybe something has to be done different in FWH 9.06 ???
All possible Tests ( 40 ).
Group Dialog with Alpha-Blended BMP and Say tested.
Transparent SAY on Image still missing ?
- Code: Select all Expand view
// nArraypos = Browser-Test !!!!!!
...
DEFINE DIALOG oDlg5 RESOURCE "Test_Dlg" STYLE nSTYLE TRANSPARENT ;
TITLE "Testing Dialog-Backgrounds" FONT oFont
REDEFINE SAY oSay1 prompt "This is a Transparent-Test" ID 210 of oDlg5 COLOR 128 PIXEL transparent adjust
oSay1:SetFont(oProgFont2)
// Color
// -------
IF nArrayPos = 2 .or. nArrayPos = 7
D_COLOR( oDlg5 )
ENDIF
// ImageBrush
// ----------------
IF nArrayPos = 3 .or. nArrayPos = 8
DB_IMAGE( oDlg5 )
ENDIF
// Style-Brush
IF nArrayPos = 4 .or. nArrayPos = 9
D_BRUSH( oDlg5 )
ENDIF
REDEFINE BUTTONBMP oButton ID 30 OF oDlg5 ;
ACTION oDlg5:End() ;
BITMAP "Quit" PROMPT " Exit" TEXTRIGHT
ACTIVATE DIALOG oDlg5 CENTERED ;
ON INIT ( DLG_BAR( oDlg5 ), IIF( nArrayPos = 1 .or. nArrayPos = 6, ;
GradBrush( oDlg5, { { 0.90,11892819,16777215 },{ 0.90,16777215,11892819 } }, .T. ), NIL ) ) ;
ON PAINT ( IIF( nArrayPos = 5 .or. nArrayPos = 10, DL_IMAGE( oDlg5, hDC ), NIL ), ; // Image
IIF( nArrayPos > 5, D_ALPHA( hDC ), NIL ) )
oProgFont1:End()
oProgFont2:End()
RETURN( NIL )
//--------- IMAGE - LOGO ------------------------
STATIC FUNCTION DL_IMAGE( oDlg5, hDC )
LOCAL oImage1
LOCAL nWidth := oDlg5:nWidth()
LOCAL nHeight := oDlg5:nHeight()
DEFINE IMAGE oImage1 FILE c_path + "\images\FANTASY7.jpg"
PalBmpDraw( hDC, 0, 0, oImage1:hBitmap, , nWIDTH, nHEIGHT, , .T. )
oDlg5:ReleaseDC()
RETURN NIL
//--------- IMAGE - BRUSH ------------------------
STATIC FUNCTION DB_IMAGE( oDlg5 )
LOCAL oImage1
DEFINE BRUSH oImage1 FILE c_path + "\images\BLUSTONE.bmp"
SET BRUSH OF oDlg5 TO oImage1
RELEASE BRUSH oImage1
RETURN NIL
//-------- STYLE- BRUSH -------------------------
STATIC FUNCTION D_BRUSH( oDlg5 )
LOCAL oNewbrush
DEFINE BRUSH oNewBrush STYLE "BRICKS"
SET BRUSH OF oWnd TO oNewBrush
RELEASE BRUSH oNewbrush
RETURN NIL
// --------- GRADIENT --------------------------------------
FUNCTION GradBrush( oDlg, aColors , lDir)
local hDC, hBmp, hBmpOld , nWidth , nHeight
DEFAULT lDir := .T.
if Empty( oDlg:oBrush:hBitmap )
nHeight := if(lDir,oDlg:nHeight,1)
nWidth := if(lDir,1,oDlg:nWidth)
hDC = CreateCompatibleDC( oDlg:GetDC() )
hBmp = CreateCompatibleBitMap( oDlg:hDC, nWidth, nHeight )
hBmpOld = SelectObject( hDC, hBmp )
GradientFill( hDC, 0, 0, nHeight, nWidth, aColors,lDir )
DeleteObject( oDlg:oBrush:hBrush )
oDlg:oBrush:hBitmap = hBmp
oDlg:oBrush:hBrush = CreatePatternBrush( hBmp )
SelectObject( hDC, hBmpOld )
oDlg:ReleaseDC()
endif
RETURN NIL
// --------- COLORS --------------------------------------
STATIC FUNCTION D_COLOR( oDlg5 )
local oBrush1
DEFINE BRUSH oBrush1 COLOR 16228426 // Blue
SET BRUSH OF oDlg5 TO oBrush1
RELEASE BRUSH oBrush1
RETURN NIL
// --------- ALPHA-BMP --------------------------------------
STATIC FUNCTION D_ALPHA( hDC )
LOCAL oBmp1
DEFINE BITMAP oBmp1 FILENAME c_path + "\images\A_LOGO.BMP"
ABPaint( hDC, 30, 50, oBmp1:hBitmap, 220 )
RETURN NIL
Best Regards
Uwe