FWH1905: Watermark behind XBrowse

FWH1905: Watermark behind XBrowse

Postby nageswaragunupudi » Tue Jun 04, 2019 11:33 am

Image

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

Re: FWH1905: Watermark behind XBrowse

Postby Silvio.Falconi » Tue Jun 04, 2019 1:51 pm

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
Silvio.Falconi
 
Posts: 7033
Joined: Thu Oct 18, 2012 7:17 pm

Re: FWH1905: Watermark behind XBrowse

Postby ukoenig » 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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: FWH1905: Watermark behind XBrowse

Postby nageswaragunupudi » 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
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: FWH1905: Watermark behind XBrowse

Postby ukoenig » Thu Apr 29, 2021 8: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 ), ::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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 30 guests