Adolfo,
with the Imagetools, You can create a background-image
with a included transparent logo :
( there will be a update in a short time )
to draw a logo on any other control like a window or dialog :
( be sure, it is a ALPHABLENDED IMAGE )
#include "FiveWin.ch"
function Main()
local oWnd, oBmp, oBrush
DEFINE BITMAP oBmp FILENAME "..\bitmaps\AlphaBmp\Trash.bmp"
DEFINE BRUSH oBrush FILENAME "..\bitmaps\backgrnd\paper2.bmp"
DEFINE WINDOW oWnd TITLE "FWH 8.05 Transparencies" ;
COLOR 0, "N/W" BRUSH oBrush
ACTIVATE WINDOW oWnd ;
ON PAINT ABPaint( hDC, 10, 10, oBmp:hBitmap, 220 ) // 0-255 transparency level
oBrush:End()
oBmp:End()
return nilTo create a MERGED image ( can include different logos with different sizes and transp.-levels ):1. Select a main-image with the button <
Load >
2. from the combobox select style :
Transp.logo3. select a alpha-logo (
You can add different logos during the painting )
4. from a combobox select the
transparent level5. from a combobox, You can define a
resize-factor6. with a
left mouseclick You can place the logo on the main-image
7. use
UNDO, if You don't like the position
8. at the end use the button <
export >, to create the image
-- You can define the
Export-filename ( saved in subdirectory EXPORT )
9. the button <
show > opens a preview of the result
- Code: Select all Expand view RUN
// -----------TRANSPARENT LOGO ----------------------
STATIC FUNCTION DRAW_LOGO( hMemDC )
LOCAL oImg0, oImg, nLWidth, nLHeight
// hMemDC = DC of the main-image
IF FILE ( cImagepath + ALLTRIM(cTLogo) )
// get the size with a defined resize-factor
DEFINE IMAGE oImg0 FILENAME cImagepath + ALLTRIM(cTLogo)
nLWidth := oImg0:nWidth * ( nLIResize / 100 )
nLHeight := oImg0:nHeight * ( nLIResize / 100 )
oImg0:End()
// load the image
oImg0 := FILoadImg( cImagepath + cTLogo )
// resize with a given resize-factor
oImg := ResizeImg( oImg0, nLWidth, nLHeight )
// nWFactor and nHFactor = display-size-factor of the main-image
IF nWFactor > 1 .and. nHFactor > 1
ABPaint( hMemDC, aPoints[1][2], aPoints[1][1], oImg, nTrLevel )
ELSE
IF nWFactor < nHFactor .OR. nWFactor < 1 .and. nHFactor > 1
ABPaint( hMemDC, aPoints[1][2] / nWFactor, aPoints[1][1] / nWFactor, oImg, nTrLevel )
ENDIF
IF nWFactor > nHFactor .OR. nWFactor > 1 .and. nHFactor < 1
ABPaint( hMemDC, aPoints[1][2] / nHFactor, aPoints[1][1] / nHFactor, oImg, nTrLevel )
ENDIF
ENDIF
ELSE
MsgAlert( "File : " + ALLTRIM(cTLogo) + CRLF + ;
"does not exist" + CRLF + ;
"to show Image !", "ERROR" )
ENDIF
RETURN( NIL )
best regards
Uwe