vb.net高手请教……vb.net水波倒影你可能强制vb.net水波倒影的声明而在使用vb.net水波倒影的时候 未声明 直接用vb.net水波倒影了
你好,有空帮我看一个vb.net的问题么?你的网络流没有实例化,在As 后面加个new 就行了
Dim networkStream as new Network…………
求一个能实现屏幕水波纹效果的vb代码'补模块3文件 。一个放不下 。
'
' 渲染子程序vb.net水波倒影,将新vb.net水波倒影的帧数据渲染到 lpDIBitsRender 中
' 算法vb.net水波倒影:
' posx = Wave1(x-1,y)-Wave1(x+1,y)+x
' posy = Wave1(x,y-1)-Wave1(x,y+1)+y
' SourceBmp(x,y) = DestBmp(posx,posy)
'
Public Sub WaveRender(lpWaveObject As WAVE_OBJECT)
Dim dwPosX As Long, dwPosY As Long, dwPtrSource As Long, dwPtrDest As Long, dwFlag As Long
Dim lpWave1 As Long, LineIdx As Long, LinePtr As Long
Dim lpDIBitsSource As Long, lpDIBitsRender As Long
Dim I As Long, J As Long
dwFlag = 0
With lpWaveObject
'Debug.Print "WaveRender ".dwFlag
If (.dwFlag And F_WO_ACTIVE) = 0 Then Exit Sub
.dwFlag = .dwFlag Or F_WO_NEED_UPDATE
lpWave1 = .lpWave1
LineIdx = .dwWaveByteWidth '像素指针
For I = 1 To .dwBmpHeight - 2
For J = 0 To .dwBmpWidth - 1
'********************************************************************
' PosY=i+像素上1能量-像素下1能量
' PosX=j+像素左1能量-像素右1能量
'********************************************************************
'LineIdx = LineIdx - .dwWaveByteWidth
LinePtr = lpWave1 + LineIdx - .dwWaveByteWidth
pLongPtr(0) = LinePtr
dwPosY = pLong(0)
LinePtr = lpWave1 + LineIdx + .dwWaveByteWidth
pLongPtr(0) = LinePtr
dwPosY = dwPosY - pLong(0) + I
LinePtr = lpWave1 + LineIdx - 4
pLongPtr(0) = LinePtr
dwPosX = pLong(0)
LinePtr = lpWave1 + LineIdx + 4
pLongPtr(0) = LinePtr
dwPosX = dwPosX - pLong(0) + J
If dwPosX0 Or dwPosY0 Then GoTo Continue
If dwPosX = .dwBmpWidth Or dwPosY = .dwBmpHeight Then GoTo Continue
'********************************************************************
' ptrSource = dwPosY * dwDIByteWidth + dwPosX * 3
' ptrDest = i * dwDIByteWidth + j * 3
'********************************************************************
'dwPtrSource = dwPosY * .dwDIByteWidth + (dwPosX + dwPosX * 2)
dwPosX = dwPosX + dwPosX * 2 'dwPosX * 3
dwPtrSource = dwPosY * .dwDIByteWidth + dwPosX
dwPtrDest = I * .dwDIByteWidth + (J + J * 2) 'dwPtrDest = I * .dwDIByteWidth +J * 3
'********************************************************************
' 渲染像素 [ptrDest] = 原始像素 [ptrSource]
'********************************************************************
lpDIBitsSource = .lpDIBitsSource + dwPtrSource
lpDIBitsRender = .lpDIBitsRender + dwPtrDest
If dwPtrSourcedwPtrDest Then
dwFlag = dwFlag Or 1 '如果存在源像素和目标像素不同vb.net水波倒影,则表示还在活动状态
'Debug.Print dwPtrSource" SR "dwPtrDest
'CopyMemory ByVal lpDIBitsRender, ByVal lpDIBitsSource, 3
Call WaveGetPixel(lpDIBitsSource, lpDIBitsRender, .dwDIByteWidth)
Else
CopyMemory ByVal lpDIBitsRender, ByVal lpDIBitsSource, 3
End If
'********************************************************************
' 继续循环
'********************************************************************
Continue:
LineIdx = LineIdx + 4 '像素++'指针4个字节
Next 'J
Next 'I
SetDIBits .hDcRender, .hBmpRender, 0, .dwBmpHeight, .lpDIBitsRender, .stBmpInfo, DIB_RGB_COLORS
If dwFlag = 0 Then .dwFlag = .dwFlag And (Not F_WO_ACTIVE)
'Debug.Print "WaveRender ".dwFlag
End With
End Sub
Public Sub WaveUpdateFrame(lpWaveObject As WAVE_OBJECT, ByVal hdc As Long, bIfForce As Boolean)
推荐阅读
- erp系统的年结工作,erp工作年终总结
- 微信订阅号如何推广,微信订阅号如何推送
- ios苹果资金结算规则,苹果公司的资金管理
- 如何做优质原创内容推广,如何做好原创
- linux系统e命令 linux e
- 微信怎么进入视频号主页,微信短视频怎么进入
- word英文怎么说,word用英文怎么说?
- 拍摄视频为什么要搞定拍摄场景,拍摄视频为什么要搞定拍摄场景呢
- 包含vb.netutc的词条