Re: drawing ellipse

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi again.
I have found a way to draw an ellipse with ming without an AS routine.
Here is the code if somebody is interesting.


    SWFShape* ellipse = new SWFShape();
    ellipse->setRightFillStyle( fillstyle );
    ellipse->setLineStyle( lineStyle );

    double x = 100.0;
    double y = 100.0;
    double width = 78.0;
    double height = 50.0;

    double j =  width * 0.70711;
    double n = height * 0.70711;
    double i = j - (height - n) * width / height;
    double m = n - (width - j) * height / width;

    ellipse->movePenTo( x + width, y );
    ellipse->drawCurveTo(x + width, y - m, x + j, y - n);
    ellipse->drawCurveTo(x + i, y - height, x, y - height);
    ellipse->drawCurveTo(x - i, y - height, x - j, y - n);
    ellipse->drawCurveTo(x - width, y - m, x - width, y);
    ellipse->drawCurveTo(x - width, y + m, x - j, y + n);
    ellipse->drawCurveTo(x - i, y + height, x, y + height);
    ellipse->drawCurveTo(x + i, y + height, x + j, y + n);
    ellipse->drawCurveTo(x + width, y + m, x + width, y);


    SWFDisplayItem* ellipseDI = swfmovie->add( ellipse );
    ellipseDI->moveTo( 10, 10 );



Sam Round wrote:
> Use an AS routine:
> http://www.video-animation.com/mx2k_01.shtml
> 
> 
> Darien Alonso Camacho wrote:
> > Hi all.
> > I am using ming with C++ and I need to draw an ellipse, but in mingpp.h
> > can not find a way to do that. Is there any way?? I see only how to draw
> > a circle. Apologize my newbie question.
> > Thanks.
> >




------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Ming-users mailing list
Ming-users@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/ming-users

[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux