Frank,
I always use without any Problems :
c_path := GETCURDIR()// use in older FWH-versions !!!
//
c_path := CURDRIVE() + ":\" + GETCURDIR()A image call :
DEFINE IMAGE oImage FILE c_path + "\Images\Logo.bmp" or a Button :
@ 5, 110 BTNBMP oWBtn5 OF oGrpD1 ;
SIZE 130, 55 PIXEL 2007 ;
NOBORDER ;
PROMPT " &Save to INI" ;
FILENAME c_path + "\Images\Save.Bmp" ;ACTION SAVE_INI() ;
FONT oDataFont ;
LEFT
oWBtn5:lTransparent := .t.
oWBtn5:cToolTip = { "Save " + CRLF + "Values","SAVE", 1, CLR_BLACK, 14089979 }
oWBtn5:SetColor( 0, )
---------------------------
It seems, You want to display a centered Logo ?From Your Test :
ON PAINT ( BmpTiled( hDC , oBmpTiled ),;
PalBmpDraw( hDC,;
( oWnd:nHeight() / 2 ) - ( oBmp:nHeight() / 2 ) - 50,;
( oWnd:nWidth() / 2 ) - ( oBmp:nWidth() / 2 ), oBmp:hBitmap ) ) /*,;
PalBmpDraw( hDC,;
( oWnd:nHeight() / 4 ) - ( oImage:nHeight() / 2 ) - 50,;
( oWnd:nWidth() / 2 ) - ( oImage:nWidth() / 2 ), oImage:hBitmap ) )*/I nearly finished my new
Logopainter ( includes a LOGO- and DIALOG-part )
What You can do :
LOGO-part
-------------
1. select any Logo
2. paint and test on any Window-background
3. move and resize
4. calculates and paints on centered Position
5. creates a working external EXE-file
6. everything works at Runtime
7. A Collection of some nice Logo-templates are included, to use as Basic, creating Your own Logo.
DIALOG-part
---------------
1. select any Dialog-background
2. test TFolderEx-transparent-painting with different Brushes in any combinationon with Dialog-backgrounds
3. transparent-painting-test of Controls inside TFolderEx and Dialog like Groups, Radios, Says ...
4. Create Gradients, Color, Brush and Image-selection.
5. Select Dialog from Code or Resource.
Selections :
Dialog :
a LOGO-Sample of a created PRG from the Tool :
- Code: Select all Expand view
#include "FiveWin.ch"
#include "Image.ch"
STATIC hDC, oWnd, oDlg, oFont
FUNCTION Main()
LOCAL oBtn1, oBtn2
LOCAL nSWidth := GetSysMetrics(0), nSHeight := GetSysMetrics(1)
SET _3DLOOK ON
SetBalloon( .T. )
c_path := GETCURDIR()
// use in older FWH-versions
// c_path := CURDRIVE() + ":\" + GETCURDIR()
DEFINE ICON oIco RESOURCE "Super"
oFont := TFont():New("Arial",0,-14,.F.,.T.,0,0,0,.T. )
DEFINE WINDOW oWnd ;
TITLE "Window / Dialog - Brushes and Logos" MENU TMenu():New()
@ nSHeight - 158, nSWidth - 100 BTNBMP oBtn1 OF oWnd ;
SIZE 80, 70 PIXEL 2007 ;
NOBORDER ;
PROMPT " &Exit" ;
FILENAME c_path + "\Images\Exit.Bmp" ;
ACTION oWnd:End() ;
FONT oFont ;
TOP
oBtn1:lTransparent := .t.
oBtn1:cToolTip = { "Exit " + CRLF + "Codetester","EXIT", 1, CLR_BLACK, 14089979 }
oBtn1:SetColor( 0, )
SET MESSAGE OF oWnd TO "Window / Dialog - Brushes and Logos" ;
CENTERED CLOCK KEYBOARD 2007
ACTIVATE WINDOW oWnd MAXIMIZED ;
ON RESIZE ( W_BACKGRD( oWnd, "PICTURE8.jpg" ), ;
PAINT_LOGO() )
SET _3DLOOK OFF
oFont:End()
RETURN NIL
// -------- WINDOW - Background ---------------
FUNCTION W_BACKGRD( oWnd, cImage )
LOCAL oBrush
DEFINE IMAGE oImage FILE c_path + "\Images\" + cImage
oBrush := TBrush():new( ,,,, ResizeBmp( oImage:hBitmap, oWnd:nWidth, oWnd:nHeight , .T. ) )
oImage:End()
oWnd:SetBrush( oBrush )
oBrush:End()
RETURN( NIL )
// ------- LOGO ---------------
FUNCTION PAINT_LOGO()
@ 221.5, 319.0 IMAGE oLogo ;
FILENAME c_Path + "\Images\Logo7.bmp" ;
NOBORDER ;
SIZE 402, 311 ;
OF oWnd ;
PIXEL ;
ADJUST ;
TRANSPARENT
oLogo:bRClicked := {|| MsgAlert( ( "Top : " + ALLTRIM(STR(oLogo:nTop())) + CRLF + ;
"Left : " + ALLTRIM(STR(oLogo:nLeft())) + CRLF + ;
"Width : " + ALLTRIM(STR(oLogo:nWidth())) + CRLF + ;
"Height : " + ALLTRIM(STR(oLogo:nHeight())) ), "Logo - Pos. and Size" ) }
RETURN ( NIL )
The Result of the created PRG : a Standalone EXE-file, compiled from inside the Tool
The needed LOGO-Top / Left for the centered Position is calculated and added to the PRG.
Best Regards
Uwe