Graphisme stocker des images dans variable(stdpicture), blocquage à 199 ???

jmberriot Messages postés 19 Date d'inscription dimanche 19 janvier 2003 Statut Membre Dernière intervention 11 avril 2008 - 15 nov. 2005 à 18:05
cs_DARKSIDIOUS Messages postés 15814 Date d'inscription jeudi 8 août 2002 Statut Membre Dernière intervention 4 mars 2013 - 16 nov. 2005 à 17:40
|
|Salut à tous
| pour les ferrus de graphismes et si quelqu' un a une réponse
| dans la Sub CopyPicture pic(199 et suivant ).vrai deviennent False| | A quoi cette limite 199 correspond et y a-t-il une soluce

| Merci à tous

*************************************
Type Spic
Img As StdPicture
Vrai As Boolean
End Type

Dim Pic(1000) As Spic ' Par exemple


''--------------------------------------------------
'' Fonction pour CopyPicture
''--------------------------------------------------
Public Function CopyPicture(ByRef frHdc As Long, Nb As Integer) As Boolean
Dim LhDC As Long
Dim LhBmpOld As Long
Dim LhBmp As Long


LhDC = CreateCompatibleDC(frHdc)
'' Condition :
If (LhDC <> 0) Then
LhBmp = CreateCompatibleBitmap(frHdc, Screen.Width \ Screen.TwipsPerPixelX, Screen.Height \ Screen.TwipsPerPixelY)
'' Condition :
If (LhBmp <> 0) Then
LhBmpOld = SelectObject(LhDC, LhBmp)
BitBlt LhDC, 0, 0, Screen.Width \ Screen.TwipsPerPixelX, Screen.Height \ Screen.TwipsPerPixelY, frHdc, 0, 0, SRCCOPY
SelectObject LhDC, LhBmpOld
DeleteObject LhDC
DeleteObject LhBmpOld
Set pic(Nb).Img = CreatePicFromHandle(LhBmp, vbPicTypeBitmap)
Else
CopyPicture = False
End If
'' Fin de condition ......

CopyPicture = True
Else
CopyPicture = False
End If
'' Fin de condition ......
DeleteDC LhDC

pic(Nb).Vrai = CopyPicture
' If Pic(Nb).Vrai = False Then MsgBox "Erreur"
End Function


''--------------------------------------------------
'' Fonction pour CreatePicFromHandle
''--------------------------------------------------
Public Function CreatePicFromHandle(ByVal hPic As Long, ByVal PicType As PictureTypeConstants) As Picture
Dim PicConv As PictDesc
Dim IGuid As Guid
If hPic = 0 Then Err.Raise 380
If PicType < 0 Or PicType > 4 Then Err.Raise 380
PicConv.PicType = PicType
PicConv.cbSizeofStruct = Len(PicConv)
PicConv.hImage = hPic
IGuid.Data1 = &H20400
IGuid.Data4(0) = &HC0
IGuid.Data4(7) = &H46
Call OleCreatePictureIndirect(PicConv, IGuid, True, CreatePicFromHandle)
End Function

3 réponses

cs_DARKSIDIOUS Messages postés 15814 Date d'inscription jeudi 8 août 2002 Statut Membre Dernière intervention 4 mars 2013 130
15 nov. 2005 à 18:22
Hum, ca te sert à quoi d'avoir autant d'image ??? (1000 ca me paraît
énorme, surtout qu'en mémoire ca va prendre une place énorme !)
Pourquoi ne pas passer par des fichiers ?



Sinon, je ne vois pas pourquoi tu est limité à 199 sûrement un problème
de fuite mémoire (limitation à 4000 handles graphiques il me semble par
processus, donc scrupte tes handles graphiques par le gestionnaire des
tâches de Windows, ca m'étonnerai pas que ca viennent de là !).

_____________________________________________________________________
DarK Sidious

Un API Viewer (pour le VB, VB.NET, C, C# et Delphi) tout en français : www.ProgOtoP.com/popapi/
0
jmberriot Messages postés 19 Date d'inscription dimanche 19 janvier 2003 Statut Membre Dernière intervention 11 avril 2008
16 nov. 2005 à 17:31
Merci pour la réponse

Le but est d'enregistrer à la volée l'écran à vitesse rapide pour par exemple recontituer un Avi
Le fait d'enregistrer sur fichiers ralentit trop le processus
Salut Je vais voir www.ProgOtoP.com/popapi/
0
cs_DARKSIDIOUS Messages postés 15814 Date d'inscription jeudi 8 août 2002 Statut Membre Dernière intervention 4 mars 2013 130
16 nov. 2005 à 17:40
C'est sûr que si tu demande du 24 images secondes, ca va ramer, c'est inévitable, réduit à 10-5 images secondes...

_____________________________________________________________________
DarK Sidious

Un API Viewer (pour le VB, VB.NET, C, C# et Delphi) tout en français : www.ProgOtoP.com/popapi/
0
Rejoignez-nous