如何减少vb6中的图像位深度(JPEG) [英] How to decrease bit depth of image(JPEG) in vb6

查看:183
本文介绍了如何减少vb6中的图像位深度(JPEG)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ib初学者在vb6中,PLZ帮助我



i有图片框,当我尝试在vb6图片框中显示该图像时,则会生成错误无效图片





显示我知道图像的深度问题



实际图片有32位深度,vb6想要24位深度图像

所以如何通过vb6转换32到24位图像深度



我尝试了什么:



朋友请帮助我,



这个代码我已经使用了,但是它不起作用







'用于位图获取的API / setting array

私有声明函数GetBitmapBits Libgdi32_

(ByVal hBitmap As Long,ByVal dwCount as Long,lpBits as Any)As Long

私有声明函数GetObject Libgdi32别名GetObjectA_

(ByVal hObject As Long,ByVal nCount As Long,lpObject as Any)As Long

Private德clare函数SetBitmapBits Libgdi32_

(ByVal hBitmap As Long,ByVal dwCount as Long,lpBits As Any)As Long

Private Declare Sub CopyMemory Libkernel32Alias RtlMoveMemory_

(任意目的地,任何来源,ByVal长度为长)





私人类型BITMAP '14字节

bmType As Long

bmWidth As Long

bmHeight As Long

bmWidthBytes As Long

bmPlanes As Integer

bmBitsPixel As Integer

bmBits As Long

结束类型



私人ImgHeader作为BITMAP



私有子Command1_Click()

Picture1.Picture = LoadPicture(c :\ emp4bit.bmp)



GetObject Picture1.Image,Len(ImgHeader),ImgHeader



MsgBoxColor depth =& ImgHeader.bmBitsPixel& 位

MsgBox每行字节=& ImgHeader.bmWidthBytes



结束Sub

解决方案

引用:

iam初学者在vb6



停止,现在!如果你要学习这些东西,不要使用已经死了很长时间的东西。



使用VB.NET代替。您可以从此处免费获取Community Edition [ ^ ]。



VB6会教你一些非常糟糕的习惯,你会去如果你想进步并转移到其他语言,必须忘掉。


iam beginner in vb6 , plz help me

i have picture box ,when i try to show that image in vb6 picture box , then it generates an error "Invalid picture"


Show i know it a bit depth problem of images

actual picture have 32 bit depth and vb6 want 24 bit depth size of images
so how to convert 32 to 24 bit depth of image through vb6

What I have tried:

friends please help me ,

this code i already use,but its doesnot work



'API for bitmap get/setting array
Private Declare Function GetBitmapBits Lib "gdi32" _
(ByVal hBitmap As Long, ByVal dwCount As Long, lpBits As Any) As Long
Private Declare Function GetObject Lib "gdi32" Alias "GetObjectA" _
(ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) As Long
Private Declare Function SetBitmapBits Lib "gdi32" _
(ByVal hBitmap As Long, ByVal dwCount As Long, lpBits As Any) As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" _
(Destination As Any, Source As Any, ByVal Length As Long)


Private 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

Private ImgHeader As BITMAP

Private Sub Command1_Click()
Picture1.Picture = LoadPicture("c:\emp4bit.bmp")

GetObject Picture1.Image, Len(ImgHeader), ImgHeader

MsgBox "Color depth = " & ImgHeader.bmBitsPixel & " bits"
MsgBox "Bytes per row = " & ImgHeader.bmWidthBytes

End Sub

解决方案

Quote:

iam beginner in vb6


STOP, right now! If you're going to learn this stuff, DO NOT use something that has been dead for quite a while now.

Use VB.NET instead. You can get the Community Edition free from here[^].

VB6 will teach you some very bad habits that you're going to have to unlearn if you want to advance and move to other languages.


这篇关于如何减少vb6中的图像位深度(JPEG)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆