标题:[求助]这段代码是用rle算法压缩黑白图像的,求高手进来查看有什么问题??? ...
只看楼主
wutasd
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2008-5-19
 问题点数:0 回复次数:0 
[求助]这段代码是用rle算法压缩黑白图像的,求高手进来查看有什么问题???
Private Sub Command1_Click()
Dim h, w As Integer
Dim x, y, bi, wi As Long
Dim cl, i As Long
Dim r, g, b As Integer
Dim fName, str As String
fName = App.Path & "\Compact.txt"
Open fName For Output As 1
h = Picture1.ScaleHeight
w = Picture1.ScaleWidth
For y = 0 To h - 1
For x = 0 To w - 1
cl = Picture1.Point(x, y)
If cl = 0 Then
If wi <> 0 Then
Print #1, wi; ";W"
wi = 0
bi = bi + 1
Else
bi = bi + 1
End If
Else
If bi <> 0 Then
Print #1, bi; ";B"
bi = 0
wi = wi + 1
Else
wi = wi + 1
End If
End If
Next x
Next y
If wi <> 0 Then
Print #1, wi; ";W"
w
End If
If bi <> 0 Then
Print #1, bi; ";B"
End If
Close #1
End Sub
搜索更多相关主题的帖子: rle 算法 黑白 图像 
2008-05-19 13:52



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-215058-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.090675 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved