Page 1 of 2

Draw Circle() or Ellipse() not good

Posted: Thu Oct 04, 2018 3:52 pm
by sinisrus
Hello,

I have problem with Circle() and Ellipse()

If i use SetFormStyle(#NORMAL) the circle or ellipse are not drawn correctly
If i use SetFormStyle(#ANTIALIAS) the circle or ellipse are correctly drawn

This is a problem for my project :(

Thank you

Code: Select all

/* Nouveau projet Hollywood */

  CreateBrush(1,25,20,#BLACK, {AlphaChannel = True, Clear=True}) ; ID de la brosse courrante

  ; NORMAL
  SelectBrush(1,#SELMODE_COMBO,2)
  SetFormStyle(#NORMAL)
  SetFillStyle(#FILLNONE)
  Circle(#LEFT,#CENTER,5,#BLUE)
  Ellipse(#RIGHT,#CENTER,5,5,#BLUE)
  EndSelect

  ScaleBrush(1,#KEEPASPRAT,"800%")
  DisplayBrush(1,#CENTER,#CENTER-70)

  /***/

  CreateBrush(2,25,20,#BLACK, {AlphaChannel = True, Clear=True}) ; ID de la brosse courrante

  ; ANTIALIAS
  SelectBrush(2,#SELMODE_COMBO,2)
  SetFormStyle(#ANTIALIAS)
  SetFillStyle(#FILLNONE)
  Circle(#LEFT,#CENTER,5,#BLUE)
  Ellipse(#RIGHT,#CENTER,5,5,#BLUE)
  EndSelect

  ScaleBrush(2,#KEEPASPRAT,"800%")
  DisplayBrush(2,#CENTER,#CENTER+70)


EscapeQuit(True)

/* Boucle infinie */
Repeat
        WaitEvent
Forever

Re: Draw Circle() or Ellipse() not good

Posted: Fri Oct 05, 2018 11:21 am
by airsoftsoftwair
Right, looks like a problem with very small radii. Will be fixed.

Re: Draw Circle() or Ellipse() not good

Posted: Fri Oct 05, 2018 1:15 pm
by sinisrus
Thank you :-)

Re: Draw Circle() or Ellipse() not good

Posted: Wed Feb 13, 2019 8:33 am
by sinisrus
Not fixed on Hollywood 8 :-(

Re: Draw Circle() or Ellipse() not good

Posted: Sat Feb 16, 2019 12:48 pm
by airsoftsoftwair
sinisrus wrote: Wed Feb 13, 2019 8:33 am Not fixed on Hollywood 8 :-(
Well, nobody said that this was fixed in Hollywood 8. You can easily work around the problem by just using the vector drawing engine. When using vector shapes circles and ellipses with small radii will look perfectly fine. Try this:

Code: Select all

ForcePathUse(True)
Circle(#LEFT,#CENTER,5,#BLUE)
Ellipse(#RIGHT,#CENTER,5,5,#BLUE)
ForcePathUse(False)
EndSelect

Re: Draw Circle() or Ellipse() not good

Posted: Wed Oct 07, 2020 6:32 pm
by airsoftsoftwair

Code: Select all

- Fix: Circles and ellipses with very small radii were rather oddly shaped

Re: Draw Circle() or Ellipse() not good

Posted: Sat Apr 17, 2021 10:54 am
by sinisrus
Hello,

I have allways bug with Ellipse()
If i use ForcePathUse() the ellipse(#GREEN) > move is not good !
If i do not use ForcePathUse() the ellipse(#BLUE) not correct drawing

Code: Select all

@DISPLAY 1, {COLOR=#WHITE} BeginDoubleBuffer(True)

K=10
Function Move()
Cls(#WHITE)
ForcePathUse(True)
BOX(50,50,10,K,#RED)
Ellipse(100,50,10,K,#GREEN)
ForcePathUse(False)

Ellipse(150,50,5,5,#BLUE)

IF (K=10) R=1 ELSEIF (K=40) R=-1 EndIF K=R+K

Flip()
EndFunction

SetInterval(1, Move, 1000/30)

Re: Draw Circle() or Ellipse() not good

Posted: Sat Apr 17, 2021 4:40 pm
by airsoftsoftwair
sinisrus wrote: Sat Apr 17, 2021 10:54 am If i use ForcePathUse() the ellipse(#GREEN) > move is not good !
Yes, this is definitely a bug.
sinisrus wrote: Sat Apr 17, 2021 10:54 am If i do not use ForcePathUse() the ellipse(#BLUE) not correct drawing
Can't reproduce this, though. What do you mean by "not correct drawing"? Can you post a screenshot what it looks like? Here it's drawn correctly.

Re: Draw Circle() or Ellipse() not good

Posted: Thu Apr 22, 2021 12:04 am
by sinisrus
see this:

Code: Select all

@DISPLAY 1, {COLOR=#WHITE}

CreateBrush(1,20,20,#BLACK, {AlphaChannel = True, Clear=True})
  SelectBrush(1,#SELMODE_COMBO,2)
  Ellipse(#CENTER,#CENTER,4,4,#BLUE)
  EndSelect

ScaleBrush(1,"400%","400%")
DisplayBrush(1,50,50)

Repeat
        WaitEvent
Forever

Re: Draw Circle() or Ellipse() not good

Posted: Sat Apr 24, 2021 2:47 pm
by airsoftsoftwair
sinisrus wrote: Thu Apr 22, 2021 12:04 am see this:
That's actually a feature because that's the way OpenCV draws ellipses with very small radii. The other one is a bug, though.