以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助]图片框的图片能局部放大吗? (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=162236) |
||||
-- 作者:lhfu -- 发布时间:2021/4/9 18:01:00 -- [求助]图片框的图片能局部放大吗? 各位老师,我在窗口的图上框中,代码是参考这样: 全局代码 Public Sub pictureBox1_MouseWheel(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Dim PictureBox1 = sender If e.Delta > 0 Then PictureBox1.Width += 50 PictureBox1.Height += 50 PictureBox1.Top -= e.Y / PictureBox1.Height * 50 PictureBox1.Left -= e.X / PictureBox1.Width * 50 Else PictureBox1.Width -= 50 PictureBox1.Height -= 50 PictureBox1.Top += e.Y / PictureBox1.Height * 50 PictureBox1.Left += e.X / PictureBox1.Width * 50 End If End Sub 窗口放一个图片框,afterload事件 Dim PictureBox1 As System.Windows.Forms.panel = e.Form.Controls("PictureBox1").basecontrol AddHandler PictureBox1.MouseWheel, AddressOf pictureBox1_MouseWheel 图片框MouseEnter事件 e.sender.Select() 想请问一下,如何将图片局部放大或者用鼠标简单移动一下位置的呢,请各位老师指导一下,谢谢!
|
||||
-- 作者:有点蓝 -- 发布时间:2021/4/10 11:40:00 --
|