dcsimg
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
    4,832

    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
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    99,783

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    5,322

    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
    Slow as hell.

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width