Page 1 of 1
FWH1905: Watermark behind XBrowse
Posted: Tue Jun 04, 2019 11:33 am
by nageswaragunupudi

Code: Select all | Expand
#include "fivewin.ch"
REQUEST DBFCDX
function Main()
local oWnd, oBrw, oFont, aImage
local nAlphaLevel := 64
USE CUSTOMER NEW VIA "DBFCDX"
DEFINE FONT oFont NAME "Calibri" SIZE 0,-15 BOLD
DEFINE WINDOW oWnd
oWnd:SetFont( oFont )
aImage := oWnd:ReadImage( "c:\fwh\bitmaps\pngs\2.png", , .t. )
@ 20,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oWnd ;
DATASOURCE "CUSTOMER" AUTOCOLS NOBORDER CELL LINES
WITH OBJECT oBrw
:lTransparent := .t.
:bPaintBack := < |Self|
FillRect( ::hDC, GetClientRect( ::hWnd ), ::oBrush:hBrush )
::DrawImage( aImage, ::DataRect():aRect, nil, nil, nAlphaLevel )
::lTransparent := .t.
return nil
>
//
:CreateFromCode()
END
ACTIVATE WINDOW oWnd CENTERED
RELEASE FONT oFont
PalBmpFree( aImage )
return nil
Re: FWH1905: Watermark behind XBrowse
Posted: Tue Jun 04, 2019 1:51 pm
by Silvio.Falconi
nice
Re: FWH1905: Watermark behind XBrowse
Posted: Wed Apr 28, 2021 11:05 am
by ukoenig
Hello,
is it possible to adjust the image to the browser-hight ( just a little bit space in between )
or centerd with a given space because the images I'm using for testing are
different in size and I woĆ¼ld like to have the same results
I changed something in
::DrawImage( aImage, ::DataRect():aRect, nil, nil, nAlphaLevel )but got no expected result
his question belongs to
viewtopic.php?f=3&t=40315&p=240787#p240787regards
Uwe

Re: FWH1905: Watermark behind XBrowse
Posted: Wed Apr 28, 2021 11:31 am
by nageswaragunupudi
In the second parameter, experiment with different values of { top, left, bottom, right }
Re: FWH1905: Watermark behind XBrowse
Posted: Thu Apr 29, 2021 8:43 am
by ukoenig
Mr. Rao,
the array returns only the painting-area and doesn't help resizing the image
In my test I'm working with 2 images. One oversized and one half size
The oversized image is adjusted to the height of the painting area
the small one keeps the size
Maybe it is possible to add a < resize-function > for the image
aImage := oWnd:ReadImage( cBackImage, , .t. )
:bPaintBack := < |Self|
FillRect( ::hDC, GetClientRect( ::hWnd ), ::oBrush:hBrush )
// MsgAlert( FW_ValToExp( ::DataRect():aRect ) ) // returns the array of the used painting area -> { 23, 24, 456, 783 }
// { top, left, bottom, right }
// ::DrawImage( aImage, ::DataRect():aRect, nil, nil, nLogoTrans ) // { 23, 24, 456, 783 }
::DrawImage( aImage, { 23, 24, 456, 783 }, nil, nil, nLogoTrans )
::lTransparent := .t.
return nil
>
imagesize < painting-area ( how to adjust )

The oversized image is adjusted to the painting-area

regards
Uwe
