请问,怎样通过滚动条调整picturebox中的图片的大小谢谢了
解决方案 »
- 取messagebox弹出的信息
- 生成好的pdf文件怎样打开
- 高分求助,只要能解决一定给分,本人从不赖帐。相信我、能帮助我的高手进。谢谢!
- 我的ListView控件怎么没有复选框呢?(我的分用完了)
- 如何解决Date error event hit err:至少一个参数没有被指定值
- 这里有分要送,请问怎样在状态栏显示无标题栏窗体的最小化图标
- 隐藏进程
- inf文件的问题,帮我解决白送100分
- 一个关于Access2000数据库打包安装的问题
- 请问怎样判断VSFlexGrid中被选中了哪几行和哪几个单元格?
- 怎样取得当前工作表的名称?
- 一個軟件可以共享一個數據庫連接嗎,比如我把gConn作為一個全局變量, 這樣做有好處嗎?
HScroll1.Value = 1
HScroll1.LargeChange = 1
HScroll1.Max = 10
End SubPrivate Sub HScroll1_Change()
Picture1.Move 3, 3, Picture1.Height * HScroll1.Value, Picture1.Width * HScroll1.Value
End Sub
Private 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 Long'在Form上放一个picture box,并事先定义好一个图片,增加一个按钮
'例2: 放大或缩小图片
'放大:
Private Sub Command1_Click()
Dim w As Integer, h As Integer
Me.ScaleMode = vbPixels
w = Picture1.Width
h = Picture1.Height
StretchBlt Picture1.hdc, 0, 0, w * 2, h * 2, Picture1.hdc, 0, 0, w, h, vbSrcCopy
End Sub
'缩小:
Private Sub Command2_Click()
Dim w As Integer, h As Integer
Me.ScaleMode = vbPixels
w = Picture1.Width
h = Picture1.Height
StretchBlt Me.hdc, 0, 0, w / 2, h / 2, Picture1.hdc, 0, 0, w, h, vbSrcCopy
End Sub
'例3: 翻转图片
'左右翻转
Private Sub Command3_Click()
Dim w As Integer, h As Integer
Me.ScaleMode = vbPixels
w = Picture1.Width
h = Picture1.Height
StretchBlt Me.hdc, w, 0, -w, h, Picture1.hdc, 0, 0, w, h, vbSrcCopy
End Sub
'上下翻转
Private Sub Command4_Click()
Dim w As Integer, h As Integer
Me.ScaleMode = vbPixels
w = Picture1.Width
h = Picture1.Height
StretchBlt Me.hdc, 0, 0, w / 2, h / 2, Picture1.hdc, 0, 0, w, h, vbSrcCopy
End Sub
'左右并且上下翻转
Private Sub Command5_Click()
Dim w As Integer, h As Integer
Me.ScaleMode = vbPixels
w = Picture1.Width
h = Picture1.Height
StretchBlt Me.hdc, w, h, -w, -h, Picture1.hdc, 0, 0, w, h, vbSrcCopy
End Sub