发布网友
共5个回答
热心网友
VB 6.0 有多强大? VB 6.0够强大 这是VB 6.0做的位图处理类 中将彩色位图
变成灰度图的部分,这个类有50多种处理方法,速度一点也不比c++慢,
VB 暂时不会淘汰的,VB 6.0可以做什么? 做一个高效的图片处理软件绰绰有余.
在VB 6.0中会用指针了,才能当c 用,VB 6.0真的好强大
Private Sub GrayScaleProcess(Optional ByVal ptrData As Long, Optional ByVal Width As Long, Optional ByVal Height As Long, Optional ByVal iLineAdd As Long, Optional ByVal iPixelAdd As Long, Optional ByVal iType As Integer)
Dim W As Long
Dim H As Long
Dim x As Long
Dim y As Long
W = Width - 1
H = Height - 1
p3ByteDest(0) = ptrData
Dim rgb(0 To 3) As Byte
Dim icolor As Long
If iType = 0 Then
For y = 0& To H
For x = 0& To W
rgb(0) = p3Dest(0)
rgb(1) = p3Dest(1)
rgb(2) = p3Dest(2)
icolor = rgb(2) * 30& + rgb(1) * 59& + rgb(0) * 11&
rgb(0) = icolor \ 100
p3Dest(0) = rgb(0)
p3Dest(1) = rgb(0)
p3Dest(2) = rgb(0)
p3ByteDest(0) = p3ByteDest(0) + iPixelAdd
Next x
p3ByteDest(0) = p3ByteDest(0) + iLineAdd
Next y
ElseIf iType = 1 Then
For y = 0& To H
For x = 0& To W
rgb(0) = p3Dest(0)
rgb(1) = p3Dest(1)
rgb(2) = p3Dest(2)
icolor = rgb(2) * 299& + rgb(1) * 587& + rgb(0) * 114& + 500&
rgb(0) = icolor \ 1000
p3Dest(0) = rgb(0)
p3Dest(1) = rgb(0)
p3Dest(2) = rgb(0)
p3ByteDest(0) = p3ByteDest(0) + iPixelAdd
Next x
p3ByteDest(0) = p3ByteDest(0) + iLineAdd
Next y
ElseIf iType = 2 Then 'Average Value
For y = 0& To H
For x = 0& To W
icolor = p3Dest(0)
icolor = icolor + p3Dest(1)
icolor = icolor + p3Dest(2)
rgb(0) = icolor \ 3
p3Dest(0) = rgb(0)
p3Dest(1) = rgb(0)
p3Dest(2) = rgb(0)
p3ByteDest(0) = p3ByteDest(0) + iPixelAdd
Next x
p3ByteDest(0) = p3ByteDest(0) + iLineAdd
Next y
ElseIf iType = 3 Then 'Max Value
For y = 0& To H
For x = 0& To W
rgb(0) = p3Dest(0)
rgb(1) = p3Dest(1)
rgb(2) = p3Dest(2)
If rgb(1) > rgb(0) Then rgb(0) = rgb(1)
If rgb(2) > rgb(0) Then rgb(0) = rgb(2)
p3Dest(0) = rgb(0)
p3Dest(1) = rgb(0)
p3Dest(2) = rgb(0)
p3ByteDest(0) = p3ByteDest(0) + iPixelAdd
Next x
p3ByteDest(0) = p3ByteDest(0) + iLineAdd
Next y
ElseIf iType = 4 Then 'Min Value
For y = 0& To H
For x = 0& To W
rgb(0) = p3Dest(0)
rgb(1) = p3Dest(1)
rgb(2) = p3Dest(2)
If rgb(1) < rgb(0) Then rgb(0) = rgb(1)
If rgb(2) < rgb(0) Then rgb(0) = rgb(2)
p3Dest(0) = rgb(0)
p3Dest(1) = rgb(0)
p3Dest(2) = rgb(0)
p3ByteDest(0) = p3ByteDest(0) + iPixelAdd
Next x
p3ByteDest(0) = p3ByteDest(0) + iLineAdd
Next y
ElseIf iType = 5 Then 'Middle Value
For y = 0& To H
For x = 0& To W
rgb(0) = p3Dest(0)
rgb(1) = p3Dest(1)
rgb(2) = p3Dest(2)
If rgb(1) > rgb(0) Then rgb(3) = rgb(1): rgb(1) = rgb(0): rgb(0) = rgb(3)
If rgb(2) < rgb(0) Then
If rgb(2) <= rgb(1) Then rgb(0) = rgb(1) Else rgb(0) = rgb(2)
End If
p3Dest(0) = rgb(0)
p3Dest(1) = rgb(0)
p3Dest(2) = rgb(0)
p3ByteDest(0) = p3ByteDest(0) + iPixelAdd
Next x
p3ByteDest(0) = p3ByteDest(0) + iLineAdd
Next y
End If
End Sub
热心网友
那要看你是做哪方面的咯。。。。VB的功能很强大滴。。。。。可以与C++相比了。。。。但C或C++的功能还高一点。。。。。通了VB以后学其他的也就容易得多了。。。。我一开始也是学VB。。后来学了C。。。太简单了。。。呵呵呵。。。
热心网友
VB功能很强大的,很多人都说有些C语言能写的VB写不出来,其实不然,用VB一样能写很强大的东西,只不过VB出来的比C晚,学起来比C简单,故造成了大家以为VB很简单的印象,其实VB往深里学的话,还是会有很大强大的功能的。
热心网友
VB6.0我刚学完,C也学过,C的功能是强大,写东西能累死人,VB比C写东西容易,但是有的东西C能写但是VB写不出来,建议学delphi去。
热心网友
我也是新手,现在主要用VB设计软件弥补公司K3系统的不足,为自己所用,公司的数据库是SQL2000的.
其实VB6还是很强大的,先专一样..等通了以后,学其他语言就相对要简单多了.