View Full Version : چگونه میشه تعداد بیت های یک عکس رو بدست آورد؟
  
A_2006
دوشنبه 23 اردیبهشت 1392, 21:29 عصر
سلام دوستان
 
چطور میشه اینکارو کرد؟
m.4.r.m
سه شنبه 24 اردیبهشت 1392, 00:07 صبح
اینو تست کن ببین همینه 
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 GetObject Lib "gdi32" Alias "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) As Long
Private Declare Function GetBitmapBits Lib "gdi32" (ByVal hBitmap As Long, ByVal dwCount As Long, lpBits As Any) As Long
Private Sub GetPictureBytes()
  Dim PicBits() As Byte, PicInfo As BITMAP
  GetObject Picture1.Picture, Len(PicInfo), PicInfo
  ReDim PicBits((PicInfo.bmWidth * PicInfo.bmHeight * 3) - 1) As Byte
  
  Text1.Text = GetBitmapBits(Picture1.Picture, UBound(PicBits), PicBits(0))
End Sub
Private Sub Command1_Click()
Call GetPictureBytes
End Sub
A_2006
سه شنبه 24 اردیبهشت 1392, 00:56 صبح
اینو تست کن ببین همینه 
 
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 GetObject Lib "gdi32" Alias "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) As Long
Private Declare Function GetBitmapBits Lib "gdi32" (ByVal hBitmap As Long, ByVal dwCount As Long, lpBits As Any) As Long
 
Private Sub GetPictureBytes()
Dim PicBits() As Byte, PicInfo As BITMAP
 
GetObject Picture1.Picture, Len(PicInfo), PicInfo
 
ReDim PicBits((PicInfo.bmWidth * PicInfo.bmHeight * 3) - 1) As Byte
 
 
Text1.Text = GetBitmapBits(Picture1.Picture, UBound(PicBits), PicBits(0))
End Sub
 
Private Sub Command1_Click()
Call GetPictureBytes
End Sub
 
 
بابا خبره تو دیگه کی هستی. ممنون :بوس:
 
vBulletin® v4.2.5, Copyright ©2000-1404, Jelsoft Enterprises Ltd.