OrenKul
April 30th, 2001, 10:44 AM
Hi all!
I am using the LoadImage and GetObject functions which I took from MSDN. What I want to know is if matching functions and struct for Jpeg or Gif are available, and if yes, How do I get it\make it without getting too deep into compression...
Module1
public Const IMAGE_BITMAP = &O0 ' used with LoadImage to load
' a bitmap
Type BITMAP '14 bytes
bmType as Long
bmWidth as Long
bmHeight as Long
bmWidthBytes as Long
bmPlanes as Integer
bmBitsPixel as Integer
bmBits as Long
End Type
Declare Function LoadImage Lib "user32" Alias "LoadImageA" _
(byval hInst as Long, byval lpsz as string, byval un1 as Long, _
byval n1 as Long, byval n2 as Long, byval un2 as Long) as Long
Declare Function GetObject Lib "gdi32" Alias "GetObjectA" _
(byval hObject as Long, byval nCount as Long, lpObject as Any) as _
Long
Form1
Dim sBitmapInfo as BITMAP ' information on the loaded image
Dim hBitmap as Long ' handle to the loaded bitmap
public sub HipHipHooray()
hBitmap = LoadImage(0, strFileName, IMAGE_BITMAP, 0, 0, _
LR_LOADFROMFILE Or LR_CREATEDIBSECTION)
If (hBitmap = 0) then
MsgBox "error, Unable to Load Bitmap", vbOKOnly, _
"Bitmap Load error"
Exit Sub
End If
Call GetObject(hBitmap, len(sBitmapInfo), sBitmapInfo)
end sub
Thanks
Oren.
~&-)
I am using the LoadImage and GetObject functions which I took from MSDN. What I want to know is if matching functions and struct for Jpeg or Gif are available, and if yes, How do I get it\make it without getting too deep into compression...
Module1
public Const IMAGE_BITMAP = &O0 ' used with LoadImage to load
' a bitmap
Type BITMAP '14 bytes
bmType as Long
bmWidth as Long
bmHeight as Long
bmWidthBytes as Long
bmPlanes as Integer
bmBitsPixel as Integer
bmBits as Long
End Type
Declare Function LoadImage Lib "user32" Alias "LoadImageA" _
(byval hInst as Long, byval lpsz as string, byval un1 as Long, _
byval n1 as Long, byval n2 as Long, byval un2 as Long) as Long
Declare Function GetObject Lib "gdi32" Alias "GetObjectA" _
(byval hObject as Long, byval nCount as Long, lpObject as Any) as _
Long
Form1
Dim sBitmapInfo as BITMAP ' information on the loaded image
Dim hBitmap as Long ' handle to the loaded bitmap
public sub HipHipHooray()
hBitmap = LoadImage(0, strFileName, IMAGE_BITMAP, 0, 0, _
LR_LOADFROMFILE Or LR_CREATEDIBSECTION)
If (hBitmap = 0) then
MsgBox "error, Unable to Load Bitmap", vbOKOnly, _
"Bitmap Load error"
Exit Sub
End If
Call GetObject(hBitmap, len(sBitmapInfo), sBitmapInfo)
end sub
Thanks
Oren.
~&-)