电平柱状动态图
来源:互联网 发布:ubuntu永久挂载硬盘 编辑:程序博客网 时间:2024/06/09 17:55
1:声明变量
Dim mdc As LongDim ddc As LongDim ldc As LongDim bmpResult As LongDim bmpLite As LongDim bmpDark As LongDim pos As Long
2:应用系统相关方法
Const LR_DEFAULTCOLOR = 0Const LR_MONOCHROME = 1Const LR_COLOR = 2Const LR_COPYRETURNORG = 4Const LR_COPYDELETEORG = 8Const LR_LOADFROMFILE = 16Const LR_LOADTRANSPARENT = 32Const LR_DEFAULTSIZE = 64Const LR_VGACOLOR = 128Const SRCCOPY = &HCC0020 ' (DWORD) dest = sourcePrivate Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As LongPrivate Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As Long, ByVal nWidth As Long, ByVal nHeight As Long) As LongPrivate Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As LongPrivate Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As LongPrivate Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As LongPrivate Declare Function ReleaseDC Lib "user32" (ByVal hWnd As Long, ByVal hdc As Long) As LongPrivate Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As LongPrivate Declare Function LoadImage Lib "user32" Alias "LoadImageA" (ByVal hInst As Long, ByVal lpsz As String, ByVal un1 As Long, ByVal n1 As Long, ByVal n2 As Long, ByVal un2 As Long) As LongPrivate Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
'Option ExplicitPrivate Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Private Sub creatImge() Dim dc As Long Dim old As Long pos = 0 bmpDark = LoadImage(0, App.path & "\GUI\dark.bmp", 0, 0, 0, LR_LOADFROMFILE) bmpLite = LoadImage(0, App.path & "\GUI\lite.bmp", 0, 0, 0, LR_LOADFROMFILE) dc = GetDC(Me.hWnd) mdc = CreateCompatibleDC(dc) ldc = CreateCompatibleDC(dc) ddc = CreateCompatibleDC(dc) 'box.Width = 640 bmpResult = CreateCompatibleBitmap(dc, 4, 214) ReleaseDC Me.hWnd, dc old = SelectObject(mdc, bmpResult) If old <> 0 Then DeleteObject old End If old = SelectObject(ldc, bmpLite) If old <> 0 Then DeleteObject old End If old = SelectObject(ddc, bmpDark) If old <> 0 Then DeleteObject old End If End Sub
last:使用;具体参数慢慢分析
Public Function setBitBlt(x As Integer, pos As Integer) If pos = 214 Then pos = 0 End If Dim dc As Long 'pos = pos + 10 If pos > 214 Then pos = 214 End If If mdc <> 0 Then BitBlt mdc, 0, 0, 4, 214, ddc, 0, 0, vbSrcCopy ' If pos < 320 Then BitBlt mdc, 0, 214 - pos, 4, pos, ldc, 0, 214 - pos, vbSrcCopy ' End If ' Else ' BitBlt mdc, 0, 0, 49, pos, ldc, 49, 0, vbSrcCopy ' End If dc = GetDC(Me.hWnd) If mdc <> 0 Then BitBlt dc, x, 190, 4, 214, mdc, 0, 0, vbSrcCopy '173 'BitBlt dc, box.Left, box.Top, 320, 240, mdc, 0, 0, vbSrcCopy 'BitBlt dc, 0, 0, 320, 20, ddc, 0, 0, vbSrcCopy 'BitBlt dc, 0, 0, pos, 20, ldc, 0, 0, vbSrcCopy 'BitBlt dc, 100, 100, 320, 20, ddc, 0, 0, vbSrcCopy 'BitBlt dc, 100, 100, pos, 20, ldc, 0, 0, vbSrcCopy End If ReleaseDC Me.hWnd, dc End If If pos = 214 Then pos = 0 End IfEnd Function
- 电平柱状动态图
- Echarts柱状折线图
- 基于highcharts.js多条曲线(或柱状)动态图(时序图)
- 关于Highcharts柱状(column)图AJAX动态赋值的问题
- Excel 画柱状簇图
- 360柱状全景图拼接
- JfreeChart例子生成柱状堆积图
- Extjs-Flash报表 柱状栈图
- Extjs-Flash报表 横向柱状栈图
- android 折线图、柱状…
- R语言-ggplot2柱状堆叠图
- echarts 圆角渐变柱状形图
- 用web chart控件实现折线,柱状,扇形图
- WebChart实现折线,柱状,扇形图--web chart控件
- Ext Js 3.2 柱状栈图的应用
- 使用WinForm Chart控件 制作饼装,柱状,折线图
- 基于AChartEngine绘制股票走势图----分时图一(走势柱状)
- 用echarts画有两条线(柱)的折线(柱状)图
- socket阻塞与非阻塞,同步与异步、I/O模型
- 大数据处理算法(非分布式处理)
- centos 6.0用yum安装中文输入法
- 游戏程序员具备
- 缓存设计,LIRS,cache锁粒度
- 电平柱状动态图
- 关于KMP算法当中的next函数
- Mac系统下Android SDK更新以及ADT无法在线下载
- c++ primer 学习笔记:类之隐含的this 指针
- 2013 吉林通化邀请赛 Tutor 有点坑的水题
- 你还不知道的sizeof()
- mvc action 有多种跳转
- 【读书笔记】《怪诞行为学》丹·艾瑞里
- Goautodial vtigerCrm 客户管理