ZjiÜt∞nφ informacφ o bitmap∞ |
Postup: ' Struktura pro ulo₧enφ infermacφ o bitmap∞ Private Type BITMAP bmType As Long bmWidth As Long bmHeight As Long bmWidthBytes As Long bmPlanes As Integer bmBitsPixel As Integer bmBits As Long End Type Private Declare Function GetObjectAPI Lib "gdi32" Alias _ "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, _ lpObject As Any) As Long ' PICT je Picture property prvku PictureBox ' WIDTH, HEIGHT vracφ velikost bitmapy ' COLORPLANES a BITSPERPIXELS vracφ informace o rozliÜenφ a barevnΘ palet∞ ' ' P°φklad: ' Dim wi As Long, he As Long, cp As Integer, bpp As Integer ' GetBitmapInfo Picture1.Picture, wi, he, cp, bpp ' Print "èφ°ka: " & wi ' Print "V²Üka: " & he ' Print "PoΦet barev: " & cp ' Print "RozliÜenφ: " & bpp Sub GetBitmapInfo(pict As StdPicture, Width As Long, Height As Long, _ ColorPlanes As Integer, BitsPerPixel As Integer) Dim bmp As BITMAP GetObjectAPI pict, Len(bmp), bmp Width = bmp.bmWidth Height = bmp.bmHeight ColorPlanes = bmp.bmPlanes BitsPerPixel = bmp.bmBitsPixel End Sub |
Autor: The Bozena |