我怎样才能在图片框滚动条 [英] How can I get scrollbars on Picturebox

查看:132
本文介绍了我怎样才能在图片框滚动条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

PictureBox的图片

我使用的:

picture.Size = bmp.Size;
picture.Image = bmp;

假设有两个整数了maxWidth maxHeigth 。结果
我想垂直/水平滚动条添加到图片时,其大小超过了maxWidth 和/或了maxHeight 。我该怎么做?

Let's say there are two integers maxWidth and maxHeigth.
I want to add vertical/horizontal scrollbar to picture when its size exceeds maxWidth and/or maxHeight. How can I do that?

推荐答案

您可以轻松地做到这一点在面板控制

You can easily do it with a Panel Control

插入面板表单,说PANEL1和设置

Insert a panel to your form, say panel1 and set

panel1.AutoScroll = TRUE;

插入图片框面板,说画面和设定

picture.SizeMode = PictureBoxSizeMode.AutoSize;

和设置图像

picture.Image = bmp;

希望这有助于

这篇关于我怎样才能在图片框滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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