FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Changing Logos at Runtime using ABPaint ?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Changing Logos at Runtime using ABPaint ?
Posted: Mon Feb 13, 2012 12:40 AM
Hello,

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 (fw): Select all Collapse
...
@ 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 (fw): Select all Collapse
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 :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Changing Logos at Runtime using ABPaint ?
Posted: Tue Feb 14, 2012 03:24 PM
A complete LOGO-editor is included now testing any Logo on any Window-brush.
From TSelect < LOGO-painter > You can switch between different Tests.

1. Testing Window-brush without Logo
2. Testing Logo using ABPaint
3. Testing Logo using TTitle
4. Testing Logo using TTitle with REFLEX
5. Adding Action on TTitle-image-click

With a Logo using TTitle, You will have a Action on Image-click, to Include a Info of You Company.

A Sample could be a TRAVEL-AGENCY.



Using TTile with REFLEX



Company-info on Image-action :



Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.

Continue the discussion