Wallpaper as background in a window

Wallpaper as background in a window

Postby rhlawek » Sun Mar 31, 2019 12:06 am

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: 194
Joined: Sun Jul 22, 2012 7:01 pm

Re: Wallpaper as background in a window

Postby rhlawek » Sun Mar 31, 2019 12:07 am

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

Re: Wallpaper as background in a window

Postby FranciscoA » Sun Mar 31, 2019 12:28 am

Hi.
Maybe, something like this?

Code: Select all  Expand view
  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.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2157
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: Wallpaper as background in a window

Postby nageswaragunupudi » Sun Mar 31, 2019 3:04 am

We recommend
Code: Select all  Expand view
#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
User avatar
nageswaragunupudi
 
Posts: 10468
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 60 guests