Changing Logos at Runtime using ABPaint ?

Changing Logos at Runtime using ABPaint ?

Postby ukoenig » 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 ?

Image

Image

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 :

Image

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 :

Image

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 :?:
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Changing Logos at Runtime using ABPaint ?

Postby ukoenig » Tue Feb 14, 2012 3: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.

Image

Using TTile with REFLEX

Image

Company-info on Image-action :

Image

Best Regards
Uwe :lol:
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 58 guests