[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

MasterChief

11/15/2004 7:12:00 PM

....is it possible to draw other things than recrangles and lines using
i.e. ControlPaint.DrawReversibleXX()? How could I draw a revsersible
bezier curve?

Thanks!

- Peder -
2 Answers

Bob Powell

11/15/2004 10:27:00 PM

0

The ControlPaint methods are very limited and are there to sidestep the
intended behaviour of GDI+ which strangely doesn't have graphics operations
that all graphics systems have had for two decades or more.

You could try to draw a bezier onto a graphics path, flatten the path to
create points and then use ControlPaint to draw the approximated curve but
not having tested it I don't know how the node point cases would work.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tips...

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/f...

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





"Peder Y" <1@nowhere.com> wrote in message
news:uN1x8b0yEHA.2804@TK2MSFTNGP15.phx.gbl...
> ...is it possible to draw other things than recrangles and lines using
> i.e. ControlPaint.DrawReversibleXX()? How could I draw a revsersible
> bezier curve?
>
> Thanks!
>
> - Peder -


MasterChief

11/16/2004 10:27:00 PM

0

Hi Bob and thanks for answering!

The problem is that the user can draw complex shapes on top of an
arbitrary size imported bitmap. If the user decides to move these
shapes, a lot of flicker is produced. Therefore I decided to look at
other programs that perform similar tasks and how they do it. Taking a
look at Macromedia Flash and PowerPoint, one will see that they move
only the outlines of the shapes, obviously in a DrawReversibleSomething
call. A workaround would be to draw these outlines on another form with
a transparency key set, but I dont believe this is the solution the
designers at Microsoft and Macromedia have used. Furthermore, such a
solution would not be drawn reversible, which is wanted.

Another thought is that a series of complex curves, approximated to
line-1pixel-points and drawn as the object(s) are moved would probably
be too slow. I don't know. Just don't want to spend hours reinventing
wheels if others have done it before.

- Peder -


Bob Powell [MVP] wrote:
> The ControlPaint methods are very limited and are there to sidestep the
> intended behaviour of GDI+ which strangely doesn't have graphics operations
> that all graphics systems have had for two decades or more.
>
> You could try to draw a bezier onto a graphics path, flatten the path to
> create points and then use ControlPaint to draw the approximated curve but
> not having tested it I don't know how the node point cases would work.
>