is it possible to release a painted Logo using ABpaint
without repainting the Background before selecting a new Logo ?
Without repainting the Background, it is not possible to replace the old Logo.
The new selected Logo is shown on Top of the 1. Logo :
works with repainting the Background :
- Code: Select all Expand view
...
@ nSHeight - 255, nSWidth - 100 BTNBMP oWBtn3 OF oWnd ;
SIZE 80, 90 PIXEL 2007 ;
NOBORDER ;
PROMPT " &Logo" + CRLF + "Select" ;
FILENAME c_path + "\Images\Preview.Bmp" ;
ACTION ( cFilter := "BMP (*.bmp)|*.bmp|", ;
cNewBITM := cGetFile32( cFilter,"Select a Logo" ,, "\" + CurDir()+ "\Images" ), ;
IIF( EMPTY( cNewBITM ), MsgAlert( "No file selected !","ATTENTION" ), ;
( cWLogo := cFileNoPath( cNewBITM ), LOGO() ) ) ) ;
FONT oFootFont ;
TOP
oWBtn3:lTransparent := .t.
oWBtn3:cToolTip = { "Logo " + CRLF + "Selection","LOGO", 1, CLR_BLACK, 14089979 }
oWBtn3:SetColor( 0, )
...
...
ACTIVATE WINDOW oWnd MAXIMIZED ;
ON INIT W_BACKGRD( oWnd, nWStyle, lWDirect, nWColorF, nWColorB, nWGradPos, cWBrush, cWImage ) ;
ON PAINT LOGO()
SET _3DLOOK OFF
oHeadFont:End()
oFootFont:End()
oBrwFont:End()
oDataFont:End()
RETURN NIL
// ----------------------
FUNCTION LOGO()
LOCAL hDC, oAlpha
hDC := oWnd:GetDC
DEFINE BITMAP oAlpha FILENAME c_Path + "\Images\" + cWLogo
ABPaint( hDC, 200, 200, oAlpha:hBitmap, 255 )
oAlpha:End()
ReleaseDC(hDC)
RETURN NIL
Another Solution with TTitle :
- Code: Select all Expand view
FUNCTION LOGO2()
LOCAL oAlpha
// get Image-size
// -------------------
DEFINE BITMAP oAlpha FILENAME c_Path + "\Images\" + cWLogo
nWidth := oAlpha:nWidth
nHeight := oAlpha:nHeight
oAlpha:End()
// Optional REFLEX, ANIMA LEVEL and ACTION
// without REFLEX => @ 5, 5 TITLE oLogo size nWidth + 10, nHeight + 10 of oWnd
@ 5, 5 TITLE oLogo size nWidth + 10, nHeight + nHeight + 10 of oWnd TRANSPARENT NOBORDER SHADOWSIZE 0 UPDATE
@ 5, 5 TITLEIMG OF oLogo BITMAP c_path + "\Images\" + cWLogo SIZE nWidth, nHeight REFLEX TRANSPARENT ANIMA LEVEL 255
RETURN NIL
Best Regards
Uwe