放大图片框后在图像内移动 [英] Move within image after zoom in a picture box

查看:105
本文介绍了放大图片框后在图像内移动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我已经启动了一个图像查看器项目,应用程序必须显示链接到部件号的特殊照片,并显示有关部件号的信息.

DB:MS Access 2007
源代码:VB.NET 2005

图片设置在PictureBox中,图片框设置为拆分面板(Panel2),缩放按钮,重置按钮,搜索按钮等.

缩放代码:

Hi comunity, i''ve been started a image viewer project, the application must show a spesific photo linked to a part number and show information about the Part number.

DB: MS Access 2007
Source Code: VB.NET 2005

The picture is set in a PictureBox, the picture Box is set into a Split Panel (Panel2), Zoom Button, Reset Button, Search Button,etc works.

Zoom code:

Me.PictureBox1.Width += 200%
        Me.PictureBox1.Height += 150%




使用此代码,我无法在图像中上下移动




with this code i cant move up and down througth the image

Private Sub SplitContainer1_MouseWheel(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles SplitContainer1.MouseWheel
    Dim myView As Point = Me.SplitContainer1.Panel2.AutoScrollPosition
    myView.X = (myView.X + 50)
    myView.Y = (myView.Y + 50)
    Me.SplitContainer1.Panel2.AutoScrollPosition = myView




但是现在我想用鼠标左键移动图像,就像鼠标看起来像平移手一样

http://www.kareprints.com/wp-content/uploads/2010/10/pan-detail.png




But now i want move througt image with left click, like when the mouse looks like Pan hand

http://www.kareprints.com/wp-content/uploads/2010/10/pan-detail.png

推荐答案

请参阅我的评论.您不需要使用PictureBox.它没有帮助您,而是只消耗了一些资源,性能和开发时间.它实际上仅适用于最简单的情况.即使您可以通过此控件获得结果,但您还是会松懈而不是收获.我会告诉你该怎么做.请查看我过去的答案:
如何从旧图纸中清除面板 [ ^ ],
在C#中绘制矩形 [在图片框内添加图片 [在mdi子表单之间画线 [在面板上捕获图形 [ Paint是一种哪种好玩的方法? (DataGridViewImageCell.Paint(...)) [
Please see my comment. You don''t need to use PictureBox. Instead of helping you, it only eats up some resources, performance and development time. It is really designed only for simplest cases. Even though you can achieve results with this control, you loose, not gain. I''ll tell your what to do instead. Please see my past answers:
How do I clear a panel from old drawing[^],
draw a rectangle in C#[^],
Append a picture within picturebox[^].

And also:
Drawing Lines between mdi child forms[^],
capture the drawing on a panel[^],
What kind of playful method is Paint? (DataGridViewImageCell.Paint(...))[^].

—SA


这篇关于放大图片框后在图像内移动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆