How can I rotate an image by certain degree

M

Mullin Yu

I can create an image object with a string printed on it. But, how I can
rotate the whole image 270 degree clockwise

static public Bitmap createSerial()
{
Graphics objGraphics;
string strSerialNo = "20031124123456-1";

// Create a bitmap...
//System.Drawing.Bitmap imgBitmap = new Bitmap(200, 30,
PixelFormat.Format32bppArgb);
System.Drawing.Bitmap imgBitmap = new Bitmap(170, 30);

// Select graphic
objGraphics = Graphics.FromImage(imgBitmap);

objGraphics.Clear(Color.White);

// Select Font
Font titleFont = new Font("Arial", 12f);

// Draw the title string
objGraphics.DrawString(strSerialNo, titleFont, new
SolidBrush(Color.Black), 10, 1);

// Rotate Image

return imgBitmap;
}
 

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