• 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

    • If nobody was using it. Then why specifically is it a shame? Windows needs be slimmer. Every feature like this is just more bloat
    • Invincible VS announced, a brutal 3v3 tag fighting game by former Killer Instinct developers by Pulasthi Ariyasinghe The Xbox Games Showcase showed off a brand-new fighting game incoming from the award-winning Invincible universe. Simply dubbed Invincible VS, the title will feature three versus three tag fighting with all sorts of heroes and villains from the franchise. Check out the announcement trailer above, which shows off some gameplay near the tail end of it. Published by Skybound Games and developed by Quarter Up, Invincible VS has a big focus on the brutality, much like its source material. There will be iconic arenas straight from the show, as well as a battle damage system to show off the carnage on the fighters themselves. "In Invincible VS, every move, every line of dialogue, every broken limb and bloodied mouth carries real cost and consequence—all building toward the bone-deep satisfaction of victory," said Invincible VS executive producer Mike Willette. "No tag fighting game has ever delivered this level of intensity and violence. This game is a love letter to the fighting game community, created by a team of passionate, experienced fans of the genre." While this is a brand-new studio that's taking on the project, it has been revealed that former members from the 2013 Killer Instinct are involved in the development. "I have said this before, and I’ll say it again: this is the most excited I’ve been about anything involving Invincible," said Invincible co-creator Robert Kirkman. "Invincible VS is crazy fun, fast, ferocious and dripping with the same over-the-top brutality that you’ll see in the comic book pages and on the show. It is a natural evolution of the franchise and it is everything that fans have been demanding for over a decade! This is without a doubt, probably the best superhero fighting game in the universe!" The title will have multiple game modes as well, including a campaign with an original story by the writer of the animated series, an arcade mode for skirmishes, and a training arena. As expected, competitive and casual online multiplayer will be available too. Invincible VS is coming out sometime in 2026 across PC, Xbox Series X|S, and PlayStation 5.
    • And how would a "real" handheld Xbox differed from that? Pray tell. Surely it too would've been a PC with a built in screen and controller, shoehorned into a handheld form factor, and running a flavour of optimised windows? You know Xbox Series X is just a PC running a heavily customised version of Windows 10, right?
    • Let me guess, just big hyped cut scenes for what is really just more run around in the same old static urban zone machine gun vs. sniper game play.
    • I am not seeing a huge difference there.
  • Recent Achievements

    • First Post
      George Almeyda earned a badge
      First Post
    • Reacting Well
      BlakeBringer earned a badge
      Reacting Well
    • Reacting Well
      Lazy_Placeholder earned a badge
      Reacting Well
    • Dedicated
      Epaminombas earned a badge
      Dedicated
    • Veteran
      Yonah went up a rank
      Veteran
  • Popular Contributors

    1. 1
      +primortal
      470
    2. 2
      +FloatingFatMan
      265
    3. 3
      ATLien_0
      235
    4. 4
      snowy owl
      219
    5. 5
      Edouard
      173
  • Tell a friend

    Love Neowin? Tell a friend!