Page 1 of 1

How to set Brush size?

PostPosted: Fri May 05, 2023 8:04 am
by dutch
Dear All,

I need to use BRUSH for background image but how can I set the size (area) of Brush, not full WINDOW/DIALOG?

Thanks in advance,
Dutch

Re: How to set Brush size?

PostPosted: Fri May 05, 2023 3:50 pm
by Natter
DEFINE BRUSH oBh COLOR 0xF0F0F0

FillRect(oDlg:hDc, {100,100,200,200}, oBh:hBrush)

oDlg:Refresh()

Re: How to set Brush size?

PostPosted: Sat May 06, 2023 9:37 am
by dutch
Dear Natter,

May I have a example, if you could?
I would like to get the BRUSH background as this picture (not full client screen, left top and bottom area).
Image
Natter wrote:DEFINE BRUSH oBh COLOR 0xF0F0F0

FillRect(oDlg:hDc, {100,100,200,200}, oBh:hBrush)

oDlg:Refresh()

Re: How to set Brush size?

PostPosted: Sat May 06, 2023 11:48 am
by nageswaragunupudi
Image brushes

Code: Select all  Expand view
DEFINE BRUSH oBrush FILE/RESOURCE <imageflle/resource> RESIZE / STRETCH
oWnd:SetBrush( oBrush )


This is all that is enough.

The image can be bmp,png,jpg or any other image type
It can be a file or resource.

You try both STRETCH and RESIZE clauses separately and decide what you prefer.
I personally prefer RESIZE and recommend instead of STRETCH.

The entire window is covered by the brush and will automatically resize when the window is resized.
Do not write any extra code more than what I suggested.

Re: How to set Brush size?

PostPosted: Sat May 06, 2023 5:03 pm
by dutch
Dear Master Rao & Natter,

I got an idea now.

Thank you so much,
Image
nageswaragunupudi wrote:Image brushes

Code: Select all  Expand view
DEFINE BRUSH oBrush FILE/RESOURCE <imageflle/resource> RESIZE / STRETCH
oWnd:SetBrush( oBrush )


This is all that is enough.

The image can be bmp,png,jpg or any other image type
It can be a file or resource.

You try both STRETCH and RESIZE clauses separately and decide what you prefer.
I personally prefer RESIZE and recommend instead of STRETCH.

The entire window is covered by the brush and will automatically resize when the window is resized.
Do not write any extra code more than what I suggested.