1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
|
'***************************************************************************************
'* CLASSE IMAGES DE RUBANS
'***************************************************************************************
'***************************************************************************************
' Auteur : Thierry GASPERMENT (Arkham46)
' v0.2 (11/03/12)
' Le code est libre pour toute utilisation
'***************************************************************************************
'***************************************************************************************
'* LIENS *
'***************************************************************************************
'** Telechargement de GdiPlus.dll
' http://www.microsoft.com/downloads/details.aspx?FamilyID=6a63ab9c-df12-4d41-933c-be590feaa05a&DisplayLang=en
'** Norme Exif
' http://www.exif.org/specifications.html
'** Liste des Tags EXIF pour Gdi+
' http://msdn2.microsoft.com/en-us/library/ms534413.aspx
'**
' Mon Site Web DVP : http://arkham46.developpez.com
'***************************************************************************************
'* EN-TETE *
'***************************************************************************************
Option Explicit
'***************************************************************************************
'* API *
'***************************************************************************************
' API diverses
Private Declare PtrSafe Function CreateStreamOnHGlobal Lib "ole32.dll" (ByRef hGlobal As Any, ByVal fDeleteOnRelease As Long, _
ByRef ppstm As Any) As Long ' Pas du Gdi+ mais necessaire pour les List lus avecGdi+
Private Declare PtrSafe Function GlobalAlloc Lib "kernel32" (ByVal wFlags As Long, ByVal dwBytes As Long) As Long
Private Declare PtrSafe Function GlobalLock Lib "kernel32" (ByVal hMem As Long) As Long
Private Declare PtrSafe Function GlobalUnlock Lib "kernel32" (ByVal hMem As Long) As Long
' API pour creation object IPictureDisp
Private Declare PtrSafe Function OleCreatePictureIndirect Lib "olepro32.dll" _
(PicDesc As PicBmp, RefIID As GUID, ByVal fPictureOwnsHandle As Long, IPic As Object) As Long
' Gestion des dll
Private Declare PtrSafe Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
' API GDI+
Private Declare PtrSafe Function GdipLoadImageFromFile Lib "gdiplus" (ByVal Filename As Long, ByRef image As Long) As Long
Private Declare PtrSafe Function GdiplusStartup Lib "gdiplus" (token As Long, LInput As GdiplusStartupInput, Optional ByVal lOutPut As Long = 0) As Long
Private Declare PtrSafe Function GdiplusShutdown Lib "gdiplus" (ByVal token As Long) As Long
Private Declare PtrSafe Function GdipDisposeImage Lib "gdiplus" (ByVal image As Long) As Long
Private Declare PtrSafe Function GdipCreateHBITMAPFromBitmap Lib "gdiplus" (ByVal bitmap As Long, ByRef hbmReturn As Long, _
ByVal Background As Long) As Long
Private Declare PtrSafe Function GdipLoadImageFromStream Lib "gdiplus" (ByVal stream As Any, ByRef image As Long) As Long
' Deplace une zone de memoire
Private Declare PtrSafe Sub RtlMoveMemory Lib "kernel32" (Destination As Any, Source As Any, ByVal length As Long)
'***************************************************************************************
'* Constantes *
'***************************************************************************************
Private Const GMEM_MOVEABLE = &H2&
'***************************************************************************************
'* Types *
'***************************************************************************************
Private Type PicBmp
Size As Long
tType As Long
hBmp As Long
hpal As Long
Reserved As Long
End Type
Private Type GUID
Data1 As Long
Data2 As Integer
Data3 As Integer
Data4(0 To 7) As Byte
End Type
Private Type GdiplusStartupInput
GdiplusVersion As Long
DebugEventCallback As Long
SuppressBackgroundThread As Long
SuppressExternalCodecs As Long
End Type
'***************************************************************************************
'* Variables *
'***************************************************************************************
Private gGdipToken As Long ' Identifiant pour GdiPlus
Private gLib As Long ' Identifiant de la librairie chargee en memoire |
Partager