zebest3000
Messages postés20Date d'inscriptionsamedi 12 octobre 2002StatutMembreDernière intervention 9 novembre 2002
-
16 oct. 2002 à 09:43
zebest3000
Messages postés20Date d'inscriptionsamedi 12 octobre 2002StatutMembreDernière intervention 9 novembre 2002
-
16 oct. 2002 à 17:21
Bonjour,
Je souhaite sauvegarder une cpature d'écran en JPEG et BMP.
En BMP tout fonctionne mais en JPEG j'obtiens une image toute noir !
Voici le code, il doit y avoir une erreur :
-------------------------------------------------------
Private Sub Main()
Form1.Visible = False
Dim hwnd&, hdc&
hwnd& = GetDesktopWindow()
hdc& = GetDC(hwnd&)
BitBlt Form2.hdc, 0, 0, Screen.Width / 15, Screen.Height / 15, hdc&, 0, 0, SRCCOPY
DoEvents
Screen.MousePointer = 11
Dim sI As String
Dim c As New cDIBSection
Dim i As Long
Set c = New cDIBSection
c.CreateFromPicture Form2.Image
sI = App.Path + "\SaveRecord.jpg"
If SaveJPG(c, sI) Then
End If
Screen.MousePointer = 1
SavePicture Form2.Image, App.Path + "\SaveRecord.bmp"
Form1.Visible = True
Unload Form2
End Sub
-------------------------------------------------------
Le problème doit venir de cet ligne :
c.CreateFromPicture Form2.Image