FWH1905: Watermark behind XBrowse

Post Reply
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

FWH1905: Watermark behind XBrowse

Post by nageswaragunupudi »

Image

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
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
Silvio.Falconi
Posts: 7140
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: FWH1905: Watermark behind XBrowse

Post by Silvio.Falconi »

nice
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
ukoenig
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: FWH1905: Watermark behind XBrowse

Post 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#p240787

regards
Uwe :?:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: FWH1905: Watermark behind XBrowse

Post by nageswaragunupudi »

In the second parameter, experiment with different values of { top, left, bottom, right }
Regards

G. N. Rao.
Hyderabad, India
User avatar
ukoenig
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: FWH1905: Watermark behind XBrowse

Post 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 )

Image

The oversized image is adjusted to the painting-area :!:

Image

regards
Uwe :D
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
Post Reply