Re: problems with flips/rotations of certain shapes
From: Bob Powell [MVP] (bob_at__spamkiller_bobpowell.net)
Date: 01/08/05
- Next message: Johannes Hofmann: "Office2003 Colors"
- Previous message: Bob Powell [MVP]: "Re: how do I save/convert a bitmap to a gif,jpg,png or xmb to display"
- In reply to: sean.slavin_at_wonderware.com: "problems with flips/rotations of certain shapes"
- Next in thread: sean.slavin_at_wonderware.com: "Re: problems with flips/rotations of certain shapes"
- Reply: sean.slavin_at_wonderware.com: "Re: problems with flips/rotations of certain shapes"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 8 Jan 2005 02:14:49 +0100
Always draw as if you were drawing to an untransformed graphics device. The
matrix you use should always be fresh. That is to say that if you're drawing
is rotated 90 degrees and flipped horizontally then do hat every time you
draw. Dont rotate 90 degrees in one cycle and then flip horizontally in the
next.
Matrices can be compounded by multiplying them together. The order in which
you multiply is important.
-- Bob Powell [MVP] Visual C#, System.Drawing Find great Windows Forms articles in Windows Forms Tips and Tricks http://www.bobpowell.net/tipstricks.htm Answer those GDI+ questions with the GDI+ FAQ http://www.bobpowell.net/faqmain.htm All new articles provide code in C# and VB.NET. Subscribe to the RSS feeds provided and never miss a new article. <sean.slavin@wonderware.com> wrote in message news:1105138006.490959.142200@f14g2000cwb.googlegroups.com... > I'm trying to debug some code and now I'm lost. Here's the problem. > > I have a graphic editor with which I can draw shapes and other > graphical items. I can also do rotations (90 degree increments, > clockwise and counterclockwise) and flips (horizontal and vertical). > With some shapes, such as a curve, they 'walk' across the screen as > they are being rotated or flipped. Rotation and flips are being > accomplished with a matrix. There is no apparent pattern to the > 'walking'. Sometimes they move only 1 in the x and y directions. > Sometimes more depending on how I've tried to compensate. I just can't > seem to put a definitive finger on where this is happening. > > As far as I can tell, the calculation for determining the shapes > bounding rectangle is off a little. I'm not sure why this occurring. > I'm hoping that someone has had experience with this type of problem. > > If my explanation is lacking, please let me know and I'll do my best to > explain further. I'm not sure if I can supply sample code but I might > be able to come up with a snippet if need be. > > Thanks in advance > > Sean >
- Next message: Johannes Hofmann: "Office2003 Colors"
- Previous message: Bob Powell [MVP]: "Re: how do I save/convert a bitmap to a gif,jpg,png or xmb to display"
- In reply to: sean.slavin_at_wonderware.com: "problems with flips/rotations of certain shapes"
- Next in thread: sean.slavin_at_wonderware.com: "Re: problems with flips/rotations of certain shapes"
- Reply: sean.slavin_at_wonderware.com: "Re: problems with flips/rotations of certain shapes"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|