I have been using small graphics via drawtiled() for some time, it works great. But now I have a wallpaper size file that I need to automatically scale to the size of the window, scale to fit basically, not tiled. I don't see how to this, and anybody point me in the right direction.
Thanks.
Robb
Wallpaper as background in a window
Re: Wallpaper as background in a window
To be a bit more clear, I can use the wallpaper as the background, it is the scaling part that I don't know how to do.
- FranciscoA
- Posts: 1964
- Joined: Fri Jul 18, 2008 1:24 am
- Location: Chinandega, Nicaragua, C.A.
Re: Wallpaper as background in a window
Hi.
Maybe, something like this?
Regards.
Maybe, something like this?
Code: Select all
oWnd:bPainted := { | hDC | PongaBmp( hDC , oBmp , oWnd ) }
ACTIVATE WINDOW oWnd MAXIMIZED
//-----------------------------------------//
STATIC FUNCTION PongaBmp( hDC, oBmp, oWnd )
PalBmpDraw( hDC, 0, 0,oBmp:hBitmap,, oWnd:oWndClient:nWidth, oWnd:oWndClient:nHeight,, .t.)
return nil
Francisco J. Alegría P.
Chinandega, Nicaragua.
Fwxh1204-MySql-TMySql
Chinandega, Nicaragua.
Fwxh1204-MySql-TMySql
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Wallpaper as background in a window
We recommend
Try both the clauses STRETCH and RESIZE and choose what you like.
Works from versions FWH 11.05 onwards.
Code: Select all
#include "fivewn.ch"
function Main()
local oWnd, oBrush
local cImage := "c:\fwh\bitmaps\sea.bmp" // or your image file
DEFINE BRUSH oBrush FILE cImage STRETCH // or RESIZE
DEFINE WINDOW oWnd BRUSH oBrush
ACTIVATE WINDOW oWnd
RELEASE BRUSH oBrush
return nil
Works from versions FWH 11.05 onwards.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India