SIGN UP MEMBER LOGIN:    
ARTICLE

Display images in different-different angles

Posted by Ghanashyam Nayak Articles | ASP.NET Programming April 23, 2011
This article shows how you can display images in different-different angles.
Reader Level:


Description : This article shows how you can display images in different-different angles. Here I show you four different types of angles. There are also other angles in which you can display your image as you need.

Original image looks like below & here this article shows you that how you can rotate a given image in different-different angle...

Rotate1.gif

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
 
namespace RotateImageInDifferentAngles
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {

                Image myImage;
                myImage = Image.FromFile("C:\\img\\Aqua6.jpeg");
                myImage.RotateFlip(RotateFlipType.RotateNoneFlipX);
                pictureBox1.Image = myImage;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
    }
}


Display image as mirror....

Rotate2.gif

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace RotateImageInDifferentAngles
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                Image myImage;
                myImage = Image.FromFile("C:\\img\\Aqua6.jpeg");
                myImage.RotateFlip(RotateFlipType.Rotate180FlipNone);
                pictureBox1.Image = myImage;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
    }
}


Display image as 180 Rotation....

Rotate3.gif

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace RotateImageInDifferentAngles
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                Image myImage;
                myImage = Image.FromFile("C:\\img\\Aqua6.jpeg");
                myImage.RotateFlip(RotateFlipType.Rotate270FlipNone);
                pictureBox1.Image = myImage;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
    }
}

Display image as 270 Rotation...

Rotate4.gif

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace RotateImageInDifferentAngles
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                Image myImage;
                myImage = Image.FromFile("C:\\img\\Aqua6.jpeg");
                myImage.RotateFlip(RotateFlipType.Rotate90FlipNone);
                pictureBox1.Image = myImage;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
    }
}


Display image as 90 Rotation...

Rotate5.gif
 

o   RotateFlipType. Rotate180FlipX

o   RotateFlipType. Rotate180FlipY

o   RotateFlipType. Rotate180FlipXY

o   RotateFlipType. Rotate270FlipX

o   RotateFlipType. Rotate270FlipY

o   RotateFlipType. Rotate270FlipXY

o   RotateFlipType. Rotate90FlipX

o   RotateFlipType. Rotate90FlipY

o   RotateFlipType. Rotate90FlipXY

o   RotateFlipType. RotateNoneFlipX

o   RotateFlipType. RotateNoneFlipY

o   RotateFlipType. RotateNoneFlipXY

Using another "RotateFlipType" and the  code above you can also rotate an image as your need.
 

Login to add your contents and source code to this article
share this article :
post comment
 
Team Foundation Server Hosting
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor