drawing a circle with FW_Box

Post Reply
User avatar
Silvio.Falconi
Posts: 7104
Joined: Thu Oct 18, 2012 7:17 pm

drawing a circle with FW_Box

Post 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 ?
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
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: drawing a circle with FW_Box

Post 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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
Silvio.Falconi
Posts: 7104
Joined: Thu Oct 18, 2012 7:17 pm

Re: drawing a circle with FW_Box

Post 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
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
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: drawing a circle with FW_Box

Post 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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
Silvio.Falconi
Posts: 7104
Joined: Thu Oct 18, 2012 7:17 pm

Re: drawing a circle with FW_Box

Post by Silvio.Falconi »

now run
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: 7104
Joined: Thu Oct 18, 2012 7:17 pm

Re: drawing a circle with FW_Box

Post 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 )
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: 7104
Joined: Thu Oct 18, 2012 7:17 pm

Re: drawing a circle with FW_Box

Post by Silvio.Falconi »

I resolved with

Image

oPrn:Ellipse(...)
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
Post Reply