Wallpaper as background in a window

Post Reply
User avatar
rhlawek
Posts: 165
Joined: Sun Jul 22, 2012 7:01 pm

Wallpaper as background in a window

Post by rhlawek »

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
User avatar
rhlawek
Posts: 165
Joined: Sun Jul 22, 2012 7:01 pm

Re: Wallpaper as background in a window

Post by rhlawek »

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.
User avatar
FranciscoA
Posts: 1964
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: Wallpaper as background in a window

Post by FranciscoA »

Hi.
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

 
Regards.
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh1204-MySql-TMySql
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Wallpaper as background in a window

Post by nageswaragunupudi »

We recommend

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
 
Try both the clauses STRETCH and RESIZE and choose what you like.

Works from versions FWH 11.05 onwards.
Regards

G. N. Rao.
Hyderabad, India
Post Reply