赞
踩
通常我们都觉得VB6.0在处理图像的能力方面表现很差,一般很少有它来做图像处理。如果把图像先装入数组,再做各种运算,最后将图像显示到图像控件,速度还是比较快的。以下是我用imagxpress控件配合此方法的代码:
模块
'Imagx是自定义变量类型
Public Type ImageX
ImageArray() As Byte
End Type
'将imagxpress控件中的图像写入数组
Function GetImage(imageOBJ As ImagXpress) As ImageX
Dim PBag As New PropertyBag
PBag.WriteProperty "Picture", imageOBJ.Picture
GetImage.ImageArray = PBag.Contents '获取容器Byte 到 B() 数组中
End Function
'将数组内容写入imagxpress控件
Sub PutImage(imageOBJ As ImagXpress,image As ImageX )
Dim PBag As New PropertyBag
PBag.Contents = image .ImageArray
Set imageOBJ.Picture = PBag.ReadProperty("Picture")
End Sub
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。