Les Snippets

Connexion

Inverser les couleurs d'une image

Niveau requis pour utiliser/comprendre cette source : 1 ( Débutant )
Créé le 27/03/2006 15:52:53 et initié par MorpionMx [Liste]
Date de mise à jour : 27/05/2006 12:55:28
Vue : 16360
Catégorie(s) : Graphique
Langages dispo pour ce code :
- C# 1.x, C# 2.x
- VB 2005, VB.NET 1.x
- PHP 3, PHP 4, PHP 5
- Delphi 5
- VB 2005, VB.NET 1.x
- C# 1.x, C# 2.x
- Delphi 5
- VB6, VBA
- Delphi 5
- Voir tous les langages pour ce code snippet



Langage : VB.NET 1.x , VB 2005
Date ajout : 06/04/2006
Posté par Charles Racaud [Liste]
DateMAJ : 06/04/2006
Public Function InvertColors(ByVal Img As System.Drawing.Image) As System.Drawing.Image
  Dim InvertAttributes As System.Drawing.Imaging.ImageAttributes
  Dim InvertMatrix As New System.Drawing.Imaging.ColorMatrix
  InvertMatrix.Matrix00 = -1
  InvertMatrix.Matrix11 = -1
  InvertMatrix.Matrix22 = -1
  InvertMatrix.Matrix33 = 1
  InvertMatrix.Matrix40 = 1
  InvertMatrix.Matrix41 = 1
  InvertMatrix.Matrix42 = 1
  InvertMatrix.Matrix44 = 1
  InvertAttributes = New System.Drawing.Imaging.ImageAttributes()
  InvertAttributes.SetColorMatrix(InvertMatrix, System.Drawing.Imaging.ColorMatrixFlag.Default, System.Drawing.Imaging.ColorAdjustType.Default)
  Dim FinalImg As New System.Drawing.Bitmap(Img.Width, Img.Height)
  Dim Graphics As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(FinalImg)
  Graphics.DrawImage(Img, New Rectangle(0, 0, FinalImg.Width, FinalImg.Height), 0, 0, FinalImg.Width, FinalImg.Height, System.Drawing.GraphicsUnit.Pixel, InvertAttributes)
  Return FinalImg
End Function

Snippets en rapport avec : Image, Inverser, Couleur, Picture, Invert



Codes sources en rapport avec : Image, Inverser, Couleur, Picture, Invert

{JAVA / J2EE} FAIRE DEFILER UNE IMAGE
...

{Flash} NEGATION D'UNE IMAGE BITMAP (FLASH 8 BETA)
Voila un petit exemple suite à la source déposée concernant flash player 8 et sa gestion des pixels....

{PHP} CRÉE UNE IMAGE DE PILE DE MINIATURES EN UTILISANT LA BIBLIOTHÈQUE GD
Tout est dans le titre. Regarder la capture pour mieux comprendre. N'hésitez pas à me contacter ...

{Visual Basic, VB6, VB.NET, VB 2005} LOUPE PICTURE BOX
AUTEUR: ProgElecT SOURCE: http://www.developpez.net/forums/d208213/autres-langages/general-visual...

{Visual Basic, VB6, VB.NET, VB 2005} CLASSER DES IMAGES EN FONCTION DE LEUR COULEUR DOMINANTE/CONTIENT UNE FONCTION DÉTECTANT LA COULEUR MOYENNE D'UNE IMAGE
Bonjour, Je poste ma première source : elle permet de classer des images en fonction de leur couleu...

{Delphi} MINIMISER LES COULEURS D' UNE IMAGE VENANT DU SCANNER OU AUTRE
Dans le même esprit que ma source : http://www.delphifr.com/codes/CHANGER-COULEUR-PIXEL-PIXELS-COUL...

{Visual Basic, VB6, VB.NET, VB 2005} PROGRESS BAR COULEURS DIFFERENTES
Bonjour, Je pense que le code est certainement deja disponible je ne veux pas faire une source de...

{Visual Basic, VB6, VB.NET, VB 2005} REDIMENSIONNER IMAGE + COMPRESSION EN JPG ( AVEC OPTION )
Bonjour, Ce controle utilisateur reprend pour plus de simplicité la methode de redimensionnement ...

{PHP} REDIMENSIONNEMENT D'UNE IMAGES, GIF, PNG, JPEG, JPG
J'éspère que ce code vous sera utile, je n'ai pas encore eu de problème avec ce code, je l'ai amélio...

{Visual Basic, VB6, VB.NET, VB 2005} TRANSFORMATION IMAGE COULEURS A IMAGE NOIR SUR BLANC
Tranformation d'une image couleurs a une image Noir sur blanc. Code bien commente pour les debutants...