How to fill a xBrowse-cell with a real image-BRUSH ?

How to fill a xBrowse-cell with a real image-BRUSH ?

Postby ukoenig » Thu Jul 15, 2021 7:23 am

Hello,
is it possible to fill and show a xBrowse-cell with a REAL brush :?:
images, colors and gradient is no problem
I need it for a brush-preview / selection ( imageline 3 )
a stretched brush-image doesn't show the real brushpreview

maybe using a GDI-solution :?:
//METHOD NewTextureBrush( oGdiBmp ) CLASS Brush
//::hBrush = GdiPlusNewTextureBrush( oGdiBmp:hbmp )
//return Self

Image

regards
Uwe
Last edited by ukoenig on Thu Jul 15, 2021 1:53 pm, edited 1 time in total.
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: How to fill a xBrowse-cell with a real image-BRUSH ?

Postby nageswaragunupudi » Thu Jul 15, 2021 12:59 pm

Code: Select all  Expand view

oCol:oBrush := oMyBrush
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10641
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: How to fill a xBrowse-cell with a real image-BRUSH ?

Postby ukoenig » Thu Jul 15, 2021 1:53 pm

Mr. Rao,

thank You very much for the replay
the image shows a splitted selection of image-backgrounds and brushes on the right
The background can be selected from one of the browsers.
I'm thinking about to display the brushimages as a TILED image adjusted to cellsize.
To create a brush for each image will be very hard to handle

Image

the images on the lefthandside I display using
:aCols[ I ]:bPaintText := { | .....
and GDI-functions
that was the reason thinking about
::hBrush = GdiPlusNewTextureBrush( oGdiBmp:hbmp ) :!:

like using for the background-images :

oImage := GDIBmp():new( c_path + cData )
oGraphics:DrawImage( oImage, nTop + nAdjust, nLeft, nWidth, nHeight )
oImage:End()
oGraphics:Destroy()

with oGraphics:DrawImage I can adjust the image to the cellsize
but not showing a brush-result

Image

best 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

Re: How to fill a xBrowse-cell with a real image-BRUSH ?

Postby ukoenig » Sat Jul 17, 2021 5:48 am

I got it working now
format change and the image adjusted to cellsize

hBmp = ReadBitmap( 0, c_path1 + cData )
hBrush = CreatePatternBrush( hBmp )


Image

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: How to fill a xBrowse-cell with a real image-BRUSH ?

Postby nageswaragunupudi » Sat Jul 17, 2021 3:17 pm

If you use a normal TBrush object, the brush is painted tiled inside the cell.
No need to do any extra coding
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10641
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 95 guests