Chinese (People's Republic of China)  English  Français


Supinfo-Projects.com
Tous les projets des élèves ingénieurs de Supinfo



Projets
  Dernier Projet
  Les plus populaires
  Tous les Projets

325 Visiteurs
3168 Projets


My Supinfo-Projects

   Connectez-vous
   Créez un Compte


Synopsis

   353 Visites
   Note INTERNET : 16
    (5 Votants)
   0 Commentaires

   Lire l'article

Evaluez cet article

20
18
16
14
12
10
8
6
4
2
0


Commentez cet article

Auteur :

Email :

Votre commentaire :



 
2004 - Pérennisation
ASP.Net GDI+
[40 mn de lecture - paru le 5/8/2004 1:54:12 PM - Public : Confirmé]

Auteur

degrem_mMichel DEGREMONT
Elève-Ingénieur Supinfo Paris
Promotion SUPINFO 2006

   Lui écrire
   Tous les projets de cet auteur
   Le mini-CV de cet auteur

5. To swivel the image

5.1. Rotation and Flip

Rotation is a common operation in many programs of Image. Rotation turns an image under an angle which is a multiple of 90. Flip reflects an image on an axis. The method of RotateFlip enables us to turn and reverse images. The value of RotateFlip is enumeration of RotateFlipType, which defines the direction of rotation and Flip. To turn and/or reverse an image, a RotateFlip call is enough.

Thanks to the RotateFlip method you will be able to carry out rotations of 90,180 and 270 degrees. But also of effect Miroir(Flip).Le table below counts the members of the RotateFlip method. It is easy to include/understand the members of the enumeration of RotateFlipType:

Member

Description

Rotate180FlipNone

rotation180-degrees but without Flip

Rotate180FlipX

rotation 180-degrees with flip horizontal

Rotate180FlipXY

rotation 180-degrees with flip horizontal and vertical

Rotate180FlipY

rotation180-degrees with flip vertical

Rotate270FlipNone

rotation270-degrees without flip

Rotate270FlipX

rotation270-degrees with flip horizontal

Rotate270FlipXY

rotation270-degrees with flip horizontal and vertical

Rotate270FlipY

rotation270-degrees with flip vertical

Rotate90FlipNone

rotation90-degrees without flip

Rotate90FlipX

rotation90-degrees with flip horizontal

Rotate90FlipXY

rotation90-degrees with flip horizontal and vertical

Rotate90FlipY

rotation90-degrees with flip vertical

RotateNoneFlipNone

Not rotation and without flip

RotateNoneFlipX

Not rotation, with flip horizontal

RotateNoneFlipXY

Not rotation, with flip horizontal and vertical

RotateNoneFlipY

Not rotation, with flip vertical

We will take that the members who can be interesting 90 degrees right-hand side and left as well as a mirror effect for made up a Rotation method:

/// <summary>
/// rotated image
/// </summary>

public void rotation(int angleDeRotation)
{
    switch(angleDeRotation)
    {
        case 90 : theImage.RotateFlip(RotateFlipType.Rotate90FlipXY); break;
        case 180 : theImage.RotateFlip(RotateFlipType.Rotate270FlipXY); break;
        default : theImage.RotateFlip(RotateFlipType.RotateNoneFlipX); break;
    }
}


5.2. False effect 3d

I call this method distorts 3d because I deform the image in 3 points in space

/// <summary>
/// distorts 3D
/// </summary>

public void fausse3D()
{
    Point[] pts =
    {
        new Point(65, 65),// dot creatre with X et Y
        new Point(300, 0),
        new Point(400, 400)
    };
    // to create the new image in which one will make the treatment
    Bitmap tempImage = new Bitmap( monImage.Width,
    monImage.Height, monImage.PixelFormat);
    Graphics g = Graphics.FromImage(tempImage);
   // prime coat
    g.Clear(System.Drawing.Color.White);
   // executions of the effect
    g.DrawImage(monImage,
    pts);
   // dispose les ressources
    g.Dispose();
    monImage.Dispose();
   // one attribute the new image in that of origin
    monImage = tempImage;
}


5.3. Call of the method of rotation

private void rotation1_Click(object sender, System.EventArgs e)
{
   String path = ImageButton1.ImageUrl.Replace("file:///","").ToString();

// instanciation of the class traitementImage
   traitementImage monImage = new traitementImage();
// load image
   monImage.chargementImage(path);
// call the method and one passes in parameter is 90,180 or 0
   monImage.rotation(90);
   String nouveaNom = Server.MapPath(Request.ApplicationPath) + "/miniaturePhoto.JPG";

// save as image under a new name
   monImage.SaveImageAs(nouveaNom);
// reloads the image in the page
   Imagebutton2.ImageUrl = Server.MapPath(Request.ApplicationPath) + "/miniaturePhoto.JPG";
}

ORIGINALE FLIP Rotated 90 left Rotated 90 right
 

5.4. Call to the method Distorts 3d

private void rotation1_Click(object sender, System.EventArgs e)
{
   String path = ImageButton1.ImageUrl.Replace("file:///","").ToString();

// instanciation of the class traitementImage
   traitementImage monImage = new traitementImage();
// loading of the image
   monImage.chargementImage(path);
// call the method 3d is distorted
   monImage.fausse3D();
   String nouveaNom = Server.MapPath(Request.ApplicationPath) + "/miniaturePhoto.JPG";

// recording of the image under a new name
   monImage.SaveImageAs(nouveaNom);
// reloads the image in the page
   Imagebutton2.ImageUrl = Server.MapPath(Request.ApplicationPath) + "/miniaturePhoto.JPG";
}

ORIGINALE DISTORTS




Articles de la même catégorie

 Pages : Top


173 Visites
0 Commentaires
Convert your XML pages in HTML
[10 mn de lecture - paru le 5/8/2004 1:12:11 PM - Public : Confirmé]

En savoir plus


323 Visites
0 Commentaires
Convertir un fichier XML en fichier HTML
[10 mn de lecture - paru le 5/8/2004 12:40:53 PM - Public : Confirmé]

En savoir plus


207 Visites
0 Commentaires
An introduction to XML
[20 mn de lecture - paru le 5/8/2004 11:23:36 AM - Public : Débutant]

En savoir plus

   Tous les Articles


SUPINFO Training Center peut vous proposer une formation ...

   Devenez Ingénieur Système Microsoft en 35 jours avec SUPINFO Training Center
   Devenez Certifiés Cisco en 13 jours avec SUPINFO Training Center
   Devenez Administrateur Système Microsoft avec SUPINFO Training Center
   Devenez Développeur Microsoft .NET en 13 jours avec SUPINFO Training Center



Powered by Campus-Booster Technology
Conditions d'utilisation & Copyright | Respect de la vie privée
© Copyright 1965-2006 Supinfo Paris, Paris Academy of Computer Science
Supinfo, Ecole Supérieure d'Informatique et Paris Academy Of Computer Science are trade marks.
23, rue de Château LANDON - 75010 PARIS - Phone : +33 (0) 153359 700 Fax : +33 (0) 153359 701

Web site autided by :