Draw and image vertically

S

Samuel

Hi everyone,

I would like to draw and image vertically using the Graphics object

Thank you in advance,
Samuel
 
F

Family Tree Mike

Samuel said:
Hi everyone,

I would like to draw and image vertically using the Graphics object

Thank you in advance,
Samuel


Your question is a little vague, as in, what does drawing virtically mean?

My guess is that one of the Graphics.DrawImage() methods should work fine
for you.
 
O

Onur Güzel

Hi everyone,

I would like to draw and image vertically using the Graphics object

Thank you in advance,
Samuel

Hi,
Though it's much clear by meaning of drawing "vertically", beside
applying "Graphics.RotateTransform" after drawing, you can use
DrawImage method of Graphics class by specifying required X and Y
coordinates. DrawImage method is overloaded and provides many
arguments that lets you to set X and Y coordinates or Rectangle that
corresponds location and size of image.

HTH,

Onur Güzel
 
S

Samuel

Though not so easily I managed using Graphics.RotateTransform

Thank you very much,
Samuel


Hi everyone,

I would like to draw and image vertically using the Graphics object

Thank you in advance,
Samuel

Hi,
Though it's much clear by meaning of drawing "vertically", beside
applying "Graphics.RotateTransform" after drawing, you can use
DrawImage method of Graphics class by specifying required X and Y
coordinates. DrawImage method is overloaded and provides many
arguments that lets you to set X and Y coordinates or Rectangle that
corresponds location and size of image.

HTH,

Onur Güzel
 
O

Onur Güzel

Though not so easily I managed using Graphics.RotateTransform

Thank you very much,
Samuel






Hi,
Though it's much clear by meaning of drawing "vertically", beside
applying "Graphics.RotateTransform" after drawing, you can use
DrawImage method of Graphics class by specifying required X and Y
coordinates. DrawImage method is overloaded and provides many
arguments that lets you to set X and Y coordinates or Rectangle that
corresponds location and size of image.

HTH,

Onur Güzel

Thanks for the feedback. You're welcome.

Onur
 
S

Samuel

Though not so easily I managed using Graphics.RotateTransform

Thank you very much,
Samuel






Hi,
Though it's much clear by meaning of drawing "vertically", beside
applying "Graphics.RotateTransform" after drawing, you can use
DrawImage method of Graphics class by specifying required X and Y
coordinates. DrawImage method is overloaded and provides many
arguments that lets you to set X and Y coordinates or Rectangle that
corresponds location and size of image.

HTH,

Onur Güzel

Thanks for the feedback. You're welcome.

Onur
----------------------------------------------------------------------
Just for your info this is the actual code that I used because the method
that you suggested I couldn't figure out hot to rotate it round the centre.
But it was certainly the starting point.

Regards,
Samuel

// Setup the transformation matrix

System.Drawing.Drawing2D.Matrix x = new System.Drawing.Drawing2D.Matrix();

// Translate to the desired co-ordinates

x.Translate(1, 1);

// Rotate about the center point of the image

// (Note we use the DPI to convert the image pixel size to inches)

x.RotateAt(90, new PointF((bmp.Width / 2), (bmp.Height / 2)));

// Apply the transformation to the graphics device

g.Transform = x;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top