extrait avec des api qui gère l'envoi d'un buffer
''''''''''''-->BUFFER'''''''''''''
Declare Function LoadImage Lib "user32" Alias "LoadImageA" (ByVal hInst As Long, ByVal lpsz As String, ByVal dwImageType As Long, ByVal dwDesiredWidth As Long, ByVal dwDesiredHeight As Long, ByVal dwFlags As Long) As Long
'Declare Function GetBitmapBits Lib "gdi32" alias "GetBitmapBits" (ByVal hBitmap As Long, ByVal dwCount As Long, lpBits As long) As Long
Declare Function SetBitmapBits Lib "gdi32" alias "SetBitmapBits" (ByVal hBitmap As Long, ByVal dwCount As Long, lpBits As long) As Long
Declare Function DeleteObject Lib "gdi32" alias "DeleteObject" (ByVal hObject As Long) As Long
Declare Function GetObject Lib "gdi32" Alias "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, lpObject As long) As Long
Type BITMAP
bmType As Long
bmWidth As Long
bmHeight As Long
bmWidthBytes As Long
bmPlanes As short
bmBitsPixel As short
bmBits As Long
End Type
dim bmpx as BITMAP
dim BPX as single
dim BTX as single' 80*60*BPX
dim hhdc as long
defint poss
Dim Nbbyte(19200) As Byte
SUB Buffer( opt as single )
DeleteObject(hhdc)
hhdc = LoadImage( 0,"ARTWORK.bmp", 0, 80, 60,&H10)
setBitmapBits (hhdc, BTX, varptr(Nbbyte(1)))
II.handle=hhdc
'GetBitmapBits (hhdc1, 19200, varptr(Nbbyte(1))) ' Clear
MEMSET(VARPTR(Nbbyte(1)), 0, BTX*SIZEOF(Byte))
MEMSET(VARPTR(mz(1)), 0, BTX*SIZEOF(single))
'ReDim mz(0) as single ' /!\ mauvaise idée, ReDim bouffe la mémoire
'ReDim mz(1 to 19200) as single ' vos mieux utiliser MEMSET(,,) pour faire un clear tableau
END SUB
j'avais fait une démo en cpu totalement , en utilisant des envois de buffer bien sûr
vos mieux manipuler une matrice de profondeur ça donne beaucoup de possibilité ...