Problème de bitmap

Résolu
snickers54 Messages postés 4 Date d'inscription vendredi 1 septembre 2006 Statut Membre Dernière intervention 4 janvier 2007 - 3 janv. 2007 à 11:45
snickers54 Messages postés 4 Date d'inscription vendredi 1 septembre 2006 Statut Membre Dernière intervention 4 janvier 2007 - 4 janv. 2007 à 16:26
Bonjour.

Dans le cadre d'un logiciel de gestion graphique, je dois a un moment
donné récupérer une zone précise d'un bitmap, mais je ne sais pas
comment faire .. quelqu'un pourrait-il me donner une solution 


merci, Cordialement, Snickers.

2 réponses

Utilisateur anonyme
3 janv. 2007 à 20:26
Salut,

Faut faire une fonction :



Private Function RecadrerImage(ByVal ImgSource As System.Drawing.Image, _
 ByVal Rect As System.Drawing.Rectangle) As System.Drawing.Image
  If ImgSource IsNot Nothing Then
    Dim ImgOut As System.Drawing.Image = New System.Drawing.Bitmap(Rect.Width, Rect.Height)
    Dim Graphics As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(ImgOut)
    Graphics.DrawImage(ImgSource, 0, 0, Rect, System.Drawing.GraphicsUnit.Pixel)
    Return ImgOut
  End If
  Return Nothing
End Function,

----

(Coloration syntaxique automatique par Kenji)





__________
Kenji
3
snickers54 Messages postés 4 Date d'inscription vendredi 1 septembre 2006 Statut Membre Dernière intervention 4 janvier 2007
4 janv. 2007 à 16:26
Merci ca fonctionne !!
0
Rejoignez-nous