How can I rotate an image by certain degree

  • Thread starter Thread starter Mullin Yu
  • Start date Start date
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;
}
 
Back
Top