Page 1 of 1

drawing a circle with FW_Box

Posted: Wed Oct 02, 2024 11:35 am
by Silvio.Falconi
Image

I draw a red circle but the border is allways black...why ?

hBrush := CreateSolidBrush(RGB(255, 28, 36))

SelectObject(hDC, hBrush)


FW_Box( hDC, { nX, nY, nX + nSize, nY + nSize }, hBrush, hBrush, , 2 )

I tried also with
FW_Box( hDC, { nX, nY, nX + nSize, nY + nSize }, RGB(243, 101, 108), RGB(243, 101, 108), , 2 )

where is the error ?

Re: drawing a circle with FW_Box

Posted: Wed Oct 02, 2024 1:37 pm
by nageswaragunupudi

Code: Select all | Expand

FW_Box( hDC, { nX, nY, nX + nSize, nY + nSize }, RGB(243, 101, 108), RGB(243, 101, 108), , 2 )
This should work.

Re: drawing a circle with FW_Box

Posted: Wed Oct 02, 2024 4:15 pm
by Silvio.Falconi
nageswaragunupudi wrote:

Code: Select all | Expand

FW_Box( hDC, { nX, nY, nX + nSize, nY + nSize }, RGB(243, 101, 108), RGB(243, 101, 108), , 2 )
This should work.
Yes but i see allways the black border

Re: drawing a circle with FW_Box

Posted: Thu Oct 03, 2024 2:58 am
by nageswaragunupudi
If a color or pen is specified as 3rd parameter, only that color/pen is used and it never uses black color.
As a test you may check

Code: Select all | Expand

   local nClr  := RGB(243, 101, 108)

   DEFINE WINDOW oWnd SIZE 200,200 PIXEL

   oWnd:bPainted := { |hDC| FW_Box( hDC, { 20,20,120,120 }, { nClr, 3 }, nil, , 2 ) }
 
The circle is drawn with the specified color only but not black.

Re: drawing a circle with FW_Box

Posted: Thu Oct 03, 2024 10:30 am
by Silvio.Falconi
now run

Re: drawing a circle with FW_Box

Posted: Fri Oct 11, 2024 9:24 am
by Silvio.Falconi
nageswaragunupudi wrote:If a color or pen is specified as 3rd parameter, only that color/pen is used and it never uses black color.
As a test you may check

Code: Select all | Expand

   local nClr  := RGB(243, 101, 108)

   DEFINE WINDOW oWnd SIZE 200,200 PIXEL

   oWnd:bPainted := { |hDC| FW_Box( hDC, { 20,20,120,120 }, { nClr, 3 }, nil, , 2 ) }
 
The circle is drawn with the specified color only but not black.

Nages, can I print with fw_box?

sample
FW_Box( oPrn:hdc, { nY, nX, nY + nPixelAltezza, nX + nPixelLarghezza }, { nClr, 3 }, nil, , 2 )

Re: drawing a circle with FW_Box

Posted: Fri Oct 11, 2024 9:33 am
by Silvio.Falconi
I resolved with

Image

oPrn:Ellipse(...)