Enregistrer un formulaire en image

Résolu
damien174 Messages postés 78 Date d'inscription jeudi 4 janvier 2001 Statut Membre Dernière intervention 2 mars 2012 - 24 oct. 2005 à 16:38
nhervagault Messages postés 6063 Date d'inscription dimanche 13 avril 2003 Statut Membre Dernière intervention 15 juillet 2011 - 25 oct. 2005 à 22:14
bonjour , je souhaiterais sauvegardé un formulaire vers une image soit BMP ou JPEG, car je dessine des graph directement sur la form et je voudrais les avoir en jpeg, c'est pour quel soit généré automatiquement sur un site web.

merci

cyberdam

9 réponses

damien174 Messages postés 78 Date d'inscription jeudi 4 janvier 2001 Statut Membre Dernière intervention 2 mars 2012
25 oct. 2005 à 21:47
slt j'ai essayer mais sans succes, soit il faut avoir le focus sur la
feuille ou sinon il prend tout l'ecran, c'est pas grave je ferais
autrement mes pages web



merci quand meme pour votre recherche :)

cyberdam
3
damien174 Messages postés 78 Date d'inscription jeudi 4 janvier 2001 Statut Membre Dernière intervention 2 mars 2012
25 oct. 2005 à 21:58
merci, mais je vais dessiné mes graph tout seul en php, comme je le fait en VB

ca va etre chiant sinon lol



merci kan meme :)


cyberdam
3
nhervagault Messages postés 6063 Date d'inscription dimanche 13 avril 2003 Statut Membre Dernière intervention 15 juillet 2011 37
24 oct. 2005 à 20:38
Salut

recherche des renseignements sur l'api
static extern IntPtr PrintWindow(IntPtr hwnd, IntPtr hDC, uint nFlags);
Désolé c'est en C#

Mais c'est une api WIN32

Donc a toi de trouver comment faire,

Voila
0
cs_Jack Messages postés 14006 Date d'inscription samedi 29 décembre 2001 Statut Modérateur Dernière intervention 28 août 2015 79
24 oct. 2005 à 20:44
Salut
Sous VB6, il n'existe pas de capture graphique.
Cherche du côté des sources qui parlent de 'capture d'écran' (ce n'est pas ce qui manque !).
Parmi elles, certaines savent gérer la capture de fenêtre seule et d'autres savent gérer la transformation BMP (ce que tu récupèreras de la capture) vers JPG.

Vala
Jack, MVP VB
NB : Je ne répondrai pas aux messages privés

Le savoir est la seule matière qui s'accroit quand on la partage. (Socrate)
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
nhervagault Messages postés 6063 Date d'inscription dimanche 13 avril 2003 Statut Membre Dernière intervention 15 juillet 2011 37
24 oct. 2005 à 22:14
Re

Voila
Un code deniché sous google, pour faire voir la capture sous VB

General declarations
Private Declare Function FindWindow
Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal
lpWindowName As String) As Long
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long

Private Declare Function GetWindowText Lib "user32" Alias
"GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal
cch As Long) As Long
Public Const GW_HWNDFIRST = 0
Public Const GW_HWNDLAST = 1
Public Const GW_HWNDNEXT = 2
Public Const GW_HWNDPREV = 3
Public Const GW_OWNER = 4
Public Const GW_CHILD = 5


'--------------------------------------------------------------------------<wbr>-
' Put this in sub main or something:
hwnd = FindWindow(0&,"The Window's Caption")
Open "out.txt" for output as #1
Call PrintWindow(hwnd, 1, 0)
'--------------------------------------------------------------------------<wbr>-


Private Sub PrintWindows(hwnd As Long, filenum As Integer, iLevel As Integer)
'Prints all window captions and handles to file
Dim hWndx As Long
Dim ts As String
Dim ts1 As String * 256
Dim rtn As Long


hWndx = GetWindow(hwnd, GW_CHILD)
Do While hWndx
rtn = GetWindowText(hWndx, ts1, 255)
'If Asc(UCase$(Left$(ts1, 1))) < Asc("A") Or Asc(UCase$(Left$(ts1, 1))) > Asc("Z") Then ts1 = ""
ts = String(iLevel, "-") & Left$(ts1, rtn) & " : " & Format$(hWndx)
Print #(filenum), ts
Call PrintWindows(hWndx, filenum, iLevel + 1)
hWndx = GetWindow(hWndx, GW_HWNDNEXT)
Loop
Print #(filenum), ""


End Sub
0
damien174 Messages postés 78 Date d'inscription jeudi 4 janvier 2001 Statut Membre Dernière intervention 2 mars 2012
24 oct. 2005 à 23:03
slt merci pour tes recherche mais ca ne marche pas, ca marque dans un fichier text le nom des controles de la from.

cyberdam
0
nhervagault Messages postés 6063 Date d'inscription dimanche 13 avril 2003 Statut Membre Dernière intervention 15 juillet 2011 37
24 oct. 2005 à 23:11
0
nhervagault Messages postés 6063 Date d'inscription dimanche 13 avril 2003 Statut Membre Dernière intervention 15 juillet 2011 37
25 oct. 2005 à 21:51
Salut

pour trouver et selectionner le handles de la fenetre

Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal
lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function BringWindowToTop Lib "user32" (ByVal hwnd As Long) As Long
dans un bouton :
Private Sub Command1_Click()
Dim hNoteWnd As Long
Dim x As Long
hNoteWnd = FindWindow("Notepad", "Sans titre - Bloc-notes")
If hNoteWnd = 0 Then
'le notepad avec le titre "Sans titre - Bloc-notes" n'est pas en mémoire
x =Shell("notepad.EXE", vbNormalFocus)
Else
'il est en mémoire : on le force en avant plan
BringWindowToTop (hNoteWnd)
End If
End Sub


Sinon, tu peux utiliser GetWindow pour obtenir la liste de toutes les
fenêtres actives :


dans un module basique :
Public Const GW_HWNDFIRST = 0
Public Const GW_HWNDNEXT = 2
Declare Function GetWindow Lib "user32" Alias "GetWindow" (ByVal hwnd As
Long, ByVal wCmd As Long) As Long
Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal
hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long


dans un bouton :
Private Sub Command1_Click()
Dim hWndNext As Long
Dim x As Long
Dim lpString As String * 255
Dim vLen As Long


hWndNext = GetWindow(hWnd, GW_HWNDFIRST)
If hWndNext <> 0 Then
vLen = GetWindowText (hWndNext , lpString , len(lpString ))
Debug.print Left(lpString ,vLen )
End If
do until hWndNext = 0
hWndNext = GetWindow(hWndNext, GW_HWNDNEXT)
vLen = GetWindowText (hWndNext , lpString , len(lpString ))
Debug.print Left(lpString ,vLen )
loop
End Sub

Voila tu y arriveras maintenant
0
nhervagault Messages postés 6063 Date d'inscription dimanche 13 avril 2003 Statut Membre Dernière intervention 15 juillet 2011 37
25 oct. 2005 à 22:14
Salut

Pour faire des graph en PHP, il faut utiliser GD.
0
Rejoignez-nous