• 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.
  • Posts

    • Microsoft shares Defender update for new Windows 11/10 ISO installs by Sayan Sen Aside from new Windows setup and recovery updates, Microsoft has also published a new Defender update for Windows 11/10/Server installation images this week. This update package is necessary as a Windows installation image may contain old, outdated anti-malware definitions and software binaries. Aside from better security, these updates can also provide improved performance benefits in some cases. When a new Windows installation is set up, there may be a temporary security risk due to outdated Microsoft Defender protection in the OS installation images. This happens because the antimalware software included in these images might not be up to date. Thus Microsoft says that these updated definitions essentially help close this protection gap. Microsoft delivered the latest security definitions for Windows images via security intelligence update version 1.431.54.0. The Defender package version is also the same. It applies to Windows 11, Windows 10 (Enterprise, Pro, and Home editions), Windows Server 2022, Windows Server 2019, and Windows Server 2016. Microsoft writes: From Microsoft's security bulletin, we learn that the security intelligence update version 1.431.452.0 was released this past week adds threat detections for various backdoor and phishing exploits, trojans, and more. For those wondering, the latest intelligence update is version 1.431.155.0 at the time of writing.
    • Probably.   You'll probably want to see what channels you'd pick up by entering your zip code here... https://www.channelmaster.com/pages/free-tv-channels   With respect to the antenna and box you selected... no idea.  They are both non-brand names and cheap.  So...sure.  I have no idea how that box records...but it's listed as a feature. Also...I have no recommendations.  I haven't recorded from a cable box (ClearQAM) in over 10 years (maybe 20?).  This was Windows Media Center/MythTV days.  My Hauppauge is just collecting dust somewhere in my expansion slot bin.
    • Yea, I tried to do that with my janky WINDOWS MEDIA CENTER Frankenstein, and it failed miserably.
    • Right next to you, buddy, we can go together 😄, God knows you need it more than me!
    • Six hours later, the price on Amazon was $399. Took a while.
  • Recent Achievements

    • First Post
      smileyhead earned a badge
      First Post
    • One Month Later
      K V earned a badge
      One Month Later
    • Week One Done
      K V earned a badge
      Week One Done
    • Dedicated
      CarlosABC earned a badge
      Dedicated
    • One Month Later
      solidox earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      640
    2. 2
      ATLien_0
      240
    3. 3
      Xenon
      172
    4. 4
      neufuse
      155
    5. 5
      +FloatingFatMan
      122
  • Tell a friend

    Love Neowin? Tell a friend!