FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour FWH1905: Watermark behind XBrowse
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
FWH1905: Watermark behind XBrowse
Posted: Tue Jun 04, 2019 11:33 AM


Code (fw): Select all Collapse
#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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: FWH1905: Watermark behind XBrowse
Posted: Tue Jun 04, 2019 01:51 PM

nice

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: FWH1905: Watermark behind XBrowse
Posted: Wed Apr 28, 2021 11:05 AM
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.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: FWH1905: Watermark behind XBrowse
Posted: Wed Apr 28, 2021 11:31 AM

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

Regards



G. N. Rao.

Hyderabad, India
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: FWH1905: Watermark behind XBrowse
Posted: Thu Apr 29, 2021 08:43 AM
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 ), ::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 :-)
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.

Continue the discussion