请问用V B制作浮雕效果 需要用到 哪些方面的知识啊。。谢谢
解决方案 »
- 数据备份进度条老提示错误,请大家帮忙看看。。。
- 关于将程序界面输出为图形的问题
- 求助:串口接收16进制数字的问题
- 请问一下关于VB中调用VC写的dll中函数的问题
- 地图中的省份对应相应的点击事件怎么实现啊,各位能不能帮帮忙,
- 求救 如何把图片框中的图片保存到硬盘上?
- vb6 XP风格按钮控件和一个coolButton
- access数据库,我想把联合查询的结果用insert into 追加到一个表中,但系统要报错,把insert into 去掉就不报错了!
- AdjustTokenPrivileges获取权限实现关机问题
- HELP!!!!!!!!!!!
- 自动生成控件的问题!
- 如果想修改IIS中web站点的asp.net版本,在vbs里面应该怎么写?
1、DIB段
2、VB特有的SafeArray数组,具体的组织结构。
3、浮雕过滤算法
http://writeblog.csdn.net/PostList.aspx?_t_=fouov5e2
Private Sub Command1_Click()
Dim r2, g2, b2 As Integer
Dim r1, g1, b1 As Integer
Dim c1 As Long
Dim c2 As Long
Dim x0 As Integer
Dim y0 As Integer
Screen.MousePointer = 11
For x0 = 1 To Picture1.Width - 2
For y0 = 1 To Picture2.Height - 2
c1 = Picture1.Point(x0, y0)
r1 = (c1 And &HFF)
g1 = (c1 And 62580) / 256
b1 = (c1 And &HFF0000) / 65536
'获得Picture1中指定点(x0,y0)的R、G、B分量值
c2 = Picture1.Point(x0 + 1, y0 + 1)
r2 = (c2 And &HFF)
g2 = (c2 And 62580) / 256
b2 = (c2 And &HFF0000) / 65536
'获得Picture1中与(x0,y0)点相邻的点的R、G、B分量值
r1 = Abs(r1 - r2 + 128)
g1 = Abs(g1 - g2 + 128)
b1 = Abs(b1 - b2 + 128)
If r1 > 255 Then r1 = 255
If r1 < 0 Then r1 = 0
If b1 > 255 Then b1 = 255
If b1 < 0 Then b1 = 0
If g1 > 255 Then g1 = 255
If g1 < 0 Then g1 = 0
'计算浮雕处理后的R、G、B分量值
Picture2.PSet (x0, y0), RGB(r1, g1, b1)
'画出浮雕处理后的(x0,y0)
DoEvents
Next
Next
Screen.MousePointer = 0End SubPrivate Sub Form_Load()
Picture1.Picture = LoadPicture(App.Path + "\鸟.bmp")
End Sub网上的一个例子,在我机子上好慢呀,供参考
Dim r2, g2, b2 As Integer
Dim r1, g1, b1 As Integer
Dim c1 As Long
Dim c2 As Long
Dim x0 As Integer
Dim y0 As Integer
Screen.MousePointer = 11
For x0 = 1 To Picture1.Width - 2
For y0 = 1 To Picture2.Height - 2
c1 = Picture1.Point(x0, y0)
r1 = (c1 And &HFF)
g1 = (c1 And 62580) / 256
b1 = (c1 And &HFF0000) / 65536
'获得Picture1中指定点(x0,y0)的R、G、B分量值
c2 = Picture1.Point(x0 + 1, y0 + 1)
r2 = (c2 And &HFF)
g2 = (c2 And 62580) / 256
b2 = (c2 And &HFF0000) / 65536
'获得Picture1中与(x0,y0)点相邻的点的R、G、B分量值
r1 = Abs(r1 - r2 + 128)
g1 = Abs(g1 - g2 + 128)
b1 = Abs(b1 - b2 + 128)
If r1 > 255 Then r1 = 255
If r1 < 0 Then r1 = 0
If b1 > 255 Then b1 = 255
If b1 < 0 Then b1 = 0
If g1 > 255 Then g1 = 255
If g1 < 0 Then g1 = 0
'计算浮雕处理后的R、G、B分量值
Picture2.PSet (x0, y0), RGB(r1, g1, b1)
'画出浮雕处理后的(x0,y0)
DoEvents
Next
Next
Screen.MousePointer = 0
http://topic.csdn.net/u/20081204/19/6b980e05-85a7-422f-a56e-9d862775303b.html