ludovicanceaux
Messages postés
440
Date d'inscription
mardi 21 octobre 2003
Statut
Membre
Dernière intervention
6 mai 2010
27 févr. 2005 à 17:18
Salut à tous,
Ca y est j'ai réussi, si ca interresse kelk'un le code c'est:
Private buffer
As Bitmap
Private
Declare
Function StretchBlt
Lib "gdi32" (
ByVal hdc
As IntPtr,
ByVal X
As
Integer, _
ByVal Y
As
Integer,
ByVal nWidth
As
Integer,
ByVal nHeight
As
Integer, _
ByVal hSrcDC
As IntPtr,
ByVal xSrc
As
Integer,
ByVal ySrc
As
Integer, _
ByVal nSrcWidth
As
Integer,
ByVal nSrcHeight
As
Integer,
ByVal dwRop
As
Integer)
As
Integer
Private
Sub Button1_Click(
ByVal sender
As System.Object,
ByVal e
As System.EventArgs)
Handles Button1.Click
Dim controlGraphics
As Graphics =
Me.PictureBox_Graphique.CreateGraphics
' graphique form
Const SRCCOPY
As
Integer = &HCC0020
Dim controlSize
As Size
controlSize =
Me.PictureBox_Graphique.ClientSize()
buffer =
New Bitmap(controlSize.Width, controlSize.Height)
Dim bufferGraphics
As Graphics = controlGraphics.FromImage(buffer)
Dim bufferHdc
As IntPtr = bufferGraphics.GetHdc
'hdc de la form
Dim controlHdc
As IntPtr = controlGraphics.GetHdc
StretchBlt(bufferHdc, 0, 0, controlSize.Width, controlSize.Height, _
controlHdc, 0, 0, controlSize.Width, controlSize.Height, SRCCOPY)
bufferGraphics.ReleaseHdc(bufferHdc)
controlGraphics.ReleaseHdc(controlHdc)
buffer.Save("C:\Documents and Settings\Ludo\Bureau\eeeezzz.Jpg", System.Drawing.Imaging.ImageFormat.Jpeg)
En revanche maintenant je désire supprimer le graphique fait ds le PictureBox en gdi+ (une fois sauvegardé) comme je dois faire
merci d'avance