Page 1 of 1

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

Posted: Thu Jul 15, 2021 7:23 am
by ukoenig
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

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

Posted: Thu Jul 15, 2021 12:59 pm
by nageswaragunupudi

Code: Select all | Expand


oCol:oBrush := oMyBrush
 

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

Posted: Thu Jul 15, 2021 1:53 pm
by ukoenig
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

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

Posted: Sat Jul 17, 2021 5:48 am
by ukoenig
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

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

Posted: Sat Jul 17, 2021 3:17 pm
by nageswaragunupudi
If you use a normal TBrush object, the brush is painted tiled inside the cell.
No need to do any extra coding