• 0

[ASP.NET/C#] rotate images


Question

I want to have some images in a folder to rotate or switch upon refresh. I googled and got rotating angles (i.e. 10 degrees or 90 degrees to the right), but that's not what i want.

I found this guide which looks interesting, but first of all it uses a database, can't it be simpler? second, their guides aren't complete! :p

Suggestions?

Link to comment
https://www.neowin.net/forum/topic/839268-aspnetc-rotate-images/
Share on other sites

5 answers to this question

Recommended Posts

  • 0

i don't have visual studio handy to test this.. but something along these lines should work (i think) ;)

// Get the image
Image img = Image.FromFile("picture.jpg");
// Enable it to be altered
Graphics g = Graphics.FromImage(img);
// Rotate
g.RotateTransform(90);
// Draw it
g.DrawImage(img, new System.Drawing.Point(1,1));
g.Dispose();

i'm not overly confident with that, but if you are still struggling i can have a look in VS when i get to work tomorrow..

  • 0
  BGM said:
i don't have visual studio handy to test this.. but something along these lines should work (i think) ;)

// Get the image

Image img = Image.FromFile("picture.jpg");

// Enable it to be altered

Graphics g = Graphics.FromImage(img);

// Rotate

g.RotateTransform(90);

// Draw it

g.DrawImage(img, new System.Drawing.Point(1,1));

g.Dispose();

i'm not overly confident with that, but if you are still struggling i can have a look in VS when i get to work tomorrow..

umm...rotate? I don't want them to actually rotate, I want my images to swap, switch, whatever.. :)

  • 0
  ultimate99 said:
umm...rotate? I don't want them to actually rotate, I want my images to swap, switch, whatever.. :)

heh, maybe i should think before typing... of course that's what you meant! hah!

yeah, there is a built in ad rotator control.. http://www.beansoftware.com/ASP.NET-Tutori...or-Control.aspx

:D

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.