Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
823 connectés 

  FORUM HardWare.fr
  Programmation
  Java

  orientation image

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

orientation image

n°1566304
vashkiry
Posté le 28-05-2007 à 17:33:46  profilanswer
 

rebonjour,
existe t il une fonction en java pour orienter une image ou faut il traiter pixel par pixel??
merci

mood
Publicité
Posté le 28-05-2007 à 17:33:46  profilanswer
 

n°1566531
vashkiry
Posté le 29-05-2007 à 09:57:22  profilanswer
 

voici une petite fonction rotate ki marche
 

Code :
  1. public void rotate(double scale)
  2. {
  3. double sinA = Math.sin(scale);
  4. AffineTransform tx = new AffineTransform();
  5. tx.rotate(scale, this.image.getWidth() / 2, this.image.getHeight() / 2);
  6. AffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_BILINEAR);
  7. Rectangle rect = op.getBounds2D(this.image).getBounds();
  8. tx.translate(sinA * rect.getX(), -sinA * rect.getY());
  9. op = new AffineTransformOp(tx,AffineTransformOp.TYPE_BILINEAR);
  10. this.image = op.filter(this.image, op.createCompatibleDestImage(this.image, null) );
  11. //putin guigui tu es trop fort
  12. this.setBounds( getX(), getY(), image.getWidth(), image.getHeight() );
  13. this.w = image.getWidth();
  14. this.h = image.getHeight();
  15. }


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  Java

  orientation image

 

Sujets relatifs
Supprimer le cadre de sélection autour d'une image lien.[RESOLU] Redimensionner une image
MSSQL : Datatype "image" : comment exporter ?upload de plusieurs image + ecriture dans une bdd
Changement de l'image d'un div au survole du curseurTester si une image "existe" (test d'url)
calé div sur une image background...IE ??[MFC] zone cliquable dans une image
Pb pour afficher nom image[Algo] Détecter l'orientation d'une image (et étapes intermédiaires)
Plus de sujets relatifs à : orientation image


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR