I must insert an image jpg as background in a window
but I know this only for bitmap and not run for jpg
sample
#define OSFONDO "D48.JPG"
...
DEFINE BITMAP oBmpSFONDO SFONDO FILENAME OSFONDO
...
ACTIVATE WINDOW oWChld MAXIMIZED;
ON PAINT (showBitmaps( oWnd, hDC, oBmpSFONDO:hBitmap,oBmpSFONDO ) )
// this is good for BMPs
STAT FUNC shwBitmaps( oWnd, hDC, hBmp, oBitmap )
LOCAL nTop := 0
LOCAL nLeft := 0
LOCAL nWidth := oWnd:nWidth()
LOCAL nHeight := oWnd:nHeight()
Local oSay
IF hBmp = 0
RETURN NIL
ENDIF
PalBmpDraw( hDC, nTop, nLeft, hBmp , , nWidth, nHeight )
Return NIL
How I can make to show a jpg ?
BACKGROUND ON A WINDOW
BACKGROUND ON A WINDOW
Best Regards, Saludos
Falconi Silvio
Falconi Silvio
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Hi Silvio:
This works for me:
Regards.
Manuel Mercado
This works for me:
Code: Select all
@ 0, 0 IMAGE oImg FILENAME C:\MG\IMAGES\MGLogom.jpg" OF oWnd:oWndClient ;
SIZE GetSysMetrics( 0 ), GetSysMetrics( 17 ) - GetSysMetrics( 15 ) - oBar:nHeight() - ;
oWnd:oMsgBar:nHeight() PIXEL ADJUST
Regards.
Manuel Mercado
I try this sample but not run ok
to try you can download the image from www.bpascal.it/d48.jpg
Code: Select all
#include "FiveWin.ch"
#define OSFONDO "D48.JPG"
static oWnd
function Main()
local oBar
DEFINE WINDOW oWnd TITLE "Test" MDI ;
MENU BuildMenu()
DEFINE BUTTONBAR oBar 3DLOOK BUTTONSIZE 39,39 OF oWnd 2007
SET MESSAGE OF oWnd TO "test image" NOINSET 2007
ACTIVATE WINDOW oWnd
return nil
function BuildMenu()
local oMenu
MENU oMenu
MENUITEM "Test"
MENU
MENUITEM "Beach" ACTION Beach()
ENDMENU
oMenu:AddMdi()
ENDMENU
return oMenu
function beach()
LOCAL oWChld
DEFINE WINDOW oWChld OF oWnd MDICHILD ;
TITLE 'Beach Plan'
@ 0, 0 IMAGE oImg FILENAME OSFONDO OF oWChld:oWndClient ;
SIZE GetSysMetrics( 0 ), GetSysMetrics( 17 ) - GetSysMetrics( 15 ) - oWnd:oBar:nHeight() - ;
oWnd:oMsgBar:nHeight() PIXEL ADJUST
cRegistro := "OMBRELLONI : "
cAutore := "Liberi : "
cSyst := "Occupati : "
SET MESSAGE OF oWChld TO "" NOINSET
DEFINE MSGITEM OF oWChld:oMSGBAR prompt cregistro size 150 ACTION nil
DEFINE MSGITEM OF oWChld:oMSGBAR prompt cAutore size 150 ACTION nil
DEFINE MSGITEM OF oWChld:oMSGBAR prompt cSyst size 150 ACTION nil
ACTIVATE WINDOW oWChld MAXIMIZED
return nil
Best Regards, Saludos
Falconi Silvio
Falconi Silvio
Hi Silvio:
@0,0 IMAGE oImg FILENAME OSFONDO OF oWChld SIZE oWChld:nWidth, oWChld:nHeight PIXEL ADJUST
Just remember that oImg is not a brush of oWChld, then other controls for this child window should belong to oImg instead of oWChld
Regards
Manuel Mercado
For a MDICHILD try this:Silvio wrote:I try this sample but not run ok
@0,0 IMAGE oImg FILENAME OSFONDO OF oWChld SIZE oWChld:nWidth, oWChld:nHeight PIXEL ADJUST
Just remember that oImg is not a brush of oWChld, then other controls for this child window should belong to oImg instead of oWChld
Regards
Manuel Mercado