Rotate, Stretch Ellipse in C# GDI+

Rotate, Stretch Ellipse in C# GDI+

Post by RGFu » Thu, 17 Apr 2008 01:03:06


I would like to draw an ellipse on a windows form and through mouse drags
stretch, rotate and relocate the ellipse.

Thanks in advance - Dan
 
 
 

1. Can I get native code add-ins when I development the add-ins using C#?

2. GDI+ DrawImage stretches incorrectly

Dear group,

I posted this question before but still don't have a clue why
DrawImage _occasionally_ drops pixels. I don't want to be pushy but
am under increasing time pressure to find a solution. So I hope
you'll pardon me for trying again under a catchier subject line.

I need to stretch a semitransparent, originally 1 pixel wide image to
a new width that is set at runtime.

I use:

pGraphics->SetInterpolationMode(InterpolationModeNearestNeighbor);
pGraphics->SetPixelOffsetMode(PixelOffsetModeHalf);

pGraphics->DrawImage(pBmap,
Rect(x,y,
dynamicWidth,height),
0,0,width,height,
UnitPixel,0,0,0);


"width" and "height" are the width and height of the image to be stretched.
"dynamicWidth" is the width that the output image is supposed to wind up
having.

This works fine for most widths. For _some_ widths, however, the resulting
stretched image is one or two pixels too small. An example of such a width
is 480 pixels. Problem is, my application needs to be able to set
the exact size of the stretched image for all widths.

How can I make sure that DrawImage will produce an image of exactly the
specified size for every specified size?


Any help greatly appreciated,

Martin Maercker

3. Finding End Points for a skewed/rotated Ellipse drawn with GraphicsPath

4. How to draw an ellipse with an rotated angle?

5. rotated, translated ellipse in parametric mode

6. Rotating Ellipse

7. Drawing Rotated Ellipses With VB6

8. a rotated ellipse

9. Rotate ellipse around center

10. Drawing Rotated Ellipses With VB 6

11. How to Draw Rotate Ellipse in visual basic 6 ???

12. Drawing rotated ellipses over data coordinates from a least squares fit

13. Determine eccentric points on a rotated ellipse?

14. GDI+ DrawImage(Bitmap, ...) stretch problem

15. Stretch bitmap with GDI+ ?