473,387 Members | 1,903 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How can I rotate an image by certain degree

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;
}
Nov 15 '05 #1
1 11592
Hi,

Did you try Image.RotateFlip method?

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

"Mullin Yu" <mu*******@ctil.com> wrote in message
news:eO**************@TK2MSFTNGP12.phx.gbl...
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;
}

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Showjumper | last post by:
Hi, I have developed an upload server controls to be reused over a number of projects. One of the tasks it needs to handle is to rotate an image. I want to accoplish this by checking the checkbox...
17
by: santel_helvis | last post by:
Hi All, Could anyone tell me how to rotate the image in javascript. Which concepts I should concentrate to rotate the image
1
by: iwdu15 | last post by:
hi, im trying to rotate a gdi drawn object on my form with a keypress....forinstance when i push the down arrow, for it to rotate the object drawn until the top is down, or if i push the right...
1
by: Yannick Benoit | last post by:
Anyone know a function that could rotate a .jpg image 90 degree to the right or left ? thanx
1
by: RC | last post by:
First, this is a SVG issue, not 100% of XML issue. But I can't find SVG group to post this. Since SVG is XML file, I post here hopefully someone know both SVG and XML can help. Here is my SVG...
8
by: Samuel Shulman | last post by:
Is it possible and how to rotate pictures in HTML document Thank you, Samuel
5
by: Gina_Marano | last post by:
Hey All, Is it possible to draw an image upside down? I am using Microsofts example of "Printing a local report without preview". The only trick is that I want to flip the image upside...
1
Thekid
by: Thekid | last post by:
Hi, I have an image similar to a clock, with numbers and letters going around in a circle. I need to extract the numbers and letters from the image and have them print out in a straight line and in...
0
by: harryusa | last post by:
I am experimenting with the rotate function and so far I can't get my code to return anything but the URL of my script. Here it is: <?php // The file you are rotating $image =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.