FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to avoid pixelation in RoundBox() ?
Posts: 989
Joined: Thu Nov 24, 2005 03:01 PM
How to avoid pixelation in RoundBox() ?
Posted: Mon Feb 16, 2015 03:53 PM
Hi friends,

i'm building buttons with a look close to a given website, and i'm almost there using BtnBmp and gradients, but drawing the button's border with RoundBox() the rounded corners appear too pixeled. ¿Is there an alternative to RoundBox so it's not so pixeled?

Saludos
Carlos Mora
http://harbouradvisor.blogspot.com/
StackOverflow http://stackoverflow.com/users/549761/carlos-mora
“If you think education is expensive, try ignorance"
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: How to avoid pixelation in RoundBox() ?
Posted: Wed Feb 18, 2015 08:21 AM
Carlos,

FWH function RoundBox() uses Microsoft API's function RoundRect(). According to MS docs:

https://msdn.microsoft.com/en-us/library/windows/desktop/dd162944%28v=vs.85%29.aspx

there are two parameters to control the used ellipse to draw the rounded corners:

nWidth [in]
The width, in logical coordinates, of the ellipse used to draw the rounded corners.
nHeight [in]
The height, in logical coordinates, of the ellipse used to draw the rounded corners.


Those parameters are params 6 and 7 when calling FWH function RoundBox()
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 989
Joined: Thu Nov 24, 2005 03:01 PM
Re: How to avoid pixelation in RoundBox() ?
Posted: Wed Feb 18, 2015 10:08 AM
Hi Antonio,

yes, 6th and 7th are the ellipse's vertical and horizontal size, but that's not the problem. I was trying to find an alternative to RoundBox/RoundRect because the ellipse drawn by this function is pixelated, it's not as smooth as in the buttons painted by Windows itself:



Corners are way more softly rounded. The only trick i can make is to have a bitmap of the corners drawn like i want an put it over the background, but sounds a little bit 'dirty'.
Saludos
Carlos Mora
http://harbouradvisor.blogspot.com/
StackOverflow http://stackoverflow.com/users/549761/carlos-mora
“If you think education is expensive, try ignorance"

Continue the discussion