Results 1 to 3 of 3

Thread: Changing the orientation of an Image?

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    Changing the orientation of an Image?

    I have some ImageButton controls on a WebForm. Some of the Images orientation are off...meaning that if you were to look at the raw image, the orientation is correct. However, some of them are sideways rather than vertical. Is there a way to check and change the orientation of the image?

    Thanks
    Blake

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: Changing the orientation of an Image?

    Orientation information for images is on the EXIF data of the image. Are you working with Image objects in C# or are you simply setting the 'src' attribute of an 'img' tag? If it's the former then this may be useful:

    https://stackoverflow.com/questions/...er-orientation

    If it's the latter then this thread probably belongs in ASP.NET and you'll need to look for a web-based solution. I found this:

    https://codepen.io/movii/pen/MJzRYr

    The language doesn't help and it's not clear to me ay a glance either, but it might be a place to start. If nothing else, using EXIF as an extra keyword in searching should help.

  3. #3
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,605

    Re: Changing the orientation of an Image?

    If there is not ready to go function on imagebutton, I haven't tried or looked but I would guess that a binded bitmap could work like: (VB)\

    Code:
     Using sbmp As New Bitmap(strImageSource)
      Case "90"
                                        sbmp.RotateFlip(RotateFlipType.Rotate90FlipNone)
                                    Case "180"
                                        sbmp.RotateFlip(RotateFlipType.Rotate180FlipNone)
                                    Case "270"
                                        sbmp.RotateFlip(RotateFlipType.Rotate270FlipNone)
    end using
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width