Hello,
for windows without FREEIMAGE I use
// window without FREEIMAGE
aImage := oWnd:ReadImage( cImage, , .t. )
oWnd:DrawImage( aImage, aRect, nil, 1 )
it doesn't work for a METRO-image-background
DEFINE METROPANEL oMetro OF oWnd TITLE "Stammdaten" ;
COLOR aVal[8], CLR_BLUE
aRect := GETCLIENTRECT( oMetro:hWnd )
aImage := oMetro:ReadImage( cImage, , .t. )
oMetro:DrawImage( aImage, aRect, nil, 1 )
a working solution
// metro image-background ( FREEIMAGE needed )
DEFINE IMAGE oImage FILENAME cImage
oBrush := TBrush():new( ,,,, ResizeBmp( oImage:hBitmap, aRect[4], aRect[3], .T. ) ) // 1 = stretch, 2 : fitoutside, 3:fitinside
oImage:End()
oMetro:SetBrush( oBrush )
RELEASE BRUSH oBrush
is it possible to define a metro-image-background without using FREEIMAGE ?
regards
Uwe
A METRO image-background without FREEIMAGE ?
A METRO image-background without FREEIMAGE ?
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.
i work with FW.
If you have any questions about special functions, maybe i can help.
Re: A METRO image-background without FREEIMAGE ?
Uwe, try with this
Code: Select all
#include "fivewin.ch"
#include "metropnl.ch"
Function Main()
local oWnd
DEFINE WINDOW oWnd TITLE "MetroPanel"
Metro()
ACTIVATE WINDOW oWnd MAXIMIZED //ON INIT Metro( oWnd )
Return nil
Function Metro( oWnd )
local oMetro
DEFINE METROPANEL oMetro OF oWnd TITLE "Stammdaten" COLOR CLR_WHITE, CLR_BLUE
oMetro:bPainted := { || oMetro:DrawImage( "D:\Fwh\FwhTeam\bitmaps\hires\earth.bmp", , nil, 1 ) }
oMetro:Show()
Return oMetro
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
Re: A METRO image-background without FREEIMAGE ?
Christobal,
thank You that works.
I added the image-background-painting to the defined brushed title-text-section
// on top
DEFINE FONT oFontLarge NAME "Arial" SIZE 0, -60 BOLD ITALIC
aPalBmp := oWnd:ReadImage( c_Pfad1 + "Marble.bmp", nil, .t. )
pBrush := GDIP_IMAGEBRUSH( aPalBmp[ 1 ] )
--
--
oMetro:Show()
oMetro:bPainted := {|| oMetro:DrawImage( c_Pfad1 + "Sea.jpg", , nil, 1 ), ;
oMetro:SayText( "Stammdaten", { 30, 150, 120, 650 }, "L", oFontLarge, pBrush ) }
regards
Uwe
thank You that works.
I added the image-background-painting to the defined brushed title-text-section
// on top
DEFINE FONT oFontLarge NAME "Arial" SIZE 0, -60 BOLD ITALIC
aPalBmp := oWnd:ReadImage( c_Pfad1 + "Marble.bmp", nil, .t. )
pBrush := GDIP_IMAGEBRUSH( aPalBmp[ 1 ] )
--
--
oMetro:Show()
oMetro:bPainted := {|| oMetro:DrawImage( c_Pfad1 + "Sea.jpg", , nil, 1 ), ;
oMetro:SayText( "Stammdaten", { 30, 150, 120, 650 }, "L", oFontLarge, pBrush ) }
regards
Uwe
Last edited by ukoenig on Sun Sep 08, 2019 8:33 am, edited 2 times in total.
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.
i work with FW.
If you have any questions about special functions, maybe i can help.
Re: A METRO image-background without FREEIMAGE ?
The following should be added to metropnel.ch:
#xcommand ACTIVATE METROPANEL <oMtr> => <oMtr>:Show()
or something similar
#xcommand ACTIVATE METROPANEL <oMtr> => <oMtr>:Show()
or something similar
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: A METRO image-background without FREEIMAGE ?
Except the TImage() class, no other class requires freeimage.dll.ukoenig wrote:Hello,
for windows without FREEIMAGE I use
// window without FREEIMAGE
aImage := oWnd:ReadImage( cImage, , .t. )
oWnd:DrawImage( aImage, aRect, nil, 1 )
it doesn't work for a METRO-image-background
DEFINE METROPANEL oMetro OF oWnd TITLE "Stammdaten" ;
COLOR aVal[8], CLR_BLUE
aRect := GETCLIENTRECT( oMetro:hWnd )
aImage := oMetro:ReadImage( cImage, , .t. )
oMetro:DrawImage( aImage, aRect, nil, 1 )
a working solution
// metro image-background ( FREEIMAGE needed )
DEFINE IMAGE oImage FILENAME cImage
oBrush := TBrush():new( ,,,, ResizeBmp( oImage:hBitmap, aRect[4], aRect[3], .T. ) ) // 1 = stretch, 2 : fitoutside, 3:fitinside
oImage:End()
oMetro:SetBrush( oBrush )
RELEASE BRUSH oBrush
is it possible to define a metro-image-background without using FREEIMAGE ?
regards
Uwe
Your approach to create the resizable brush is round about.
You will get the correct results if you keep you code simple.
Use this one line code, which does everything for you
Code: Select all
DEFINE BRUSH oBrush FILE <anyimagesource> RESIZE
It will keep resizing when the window is resized.
Avoid doing resize yourself in your application program
Code: Select all
oMetro:SetBrush( oBrush )
Freeimage.dll is not required.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: A METRO image-background without FREEIMAGE ?
Thank You very much,
it works fine with the changes.
regards
Uwe
it works fine with the changes.
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.
i work with FW.
If you have any questions about special functions, maybe i can help.