如何将捕获的图像(用相机)缩放到特定PictureBox的大小?

发布于 2024-12-21 23:40:54 字数 373 浏览 3 评论 0原文

我想缩放捕获的图像并将其显示在我在表单中找到的图片框中。

当我这样做时(其中 filename 是捕获图像的名称,imgImage 是图片框)

imgImage.Image = new Bitmap(filename)

,那么屏幕上只能看到照片的一部分(根据至决议)。

编辑:

这里的问题是(我认为)Bitmap的构造函数有一个版本

Bitmap(string filename, int width, int height) 甚至 Bitmap(Image, Size) 但移动框架不支持它。

I want to scale captured image and show it in the picture box which I have located in the form.

When I do it like this (where filename is the name of the captured image and imgImage is the pictureBox)

imgImage.Image = new Bitmap(filename)

then only part of the photo can be seen on the screen ( according to the resolution ).

EDIT:

The problem here is that (I think) there is a version of Bitmap's constructor

Bitmap(string filename, int width, int height) or even Bitmap(Image, Size) but it's not supported on mobile framework.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

神爱温柔 2024-12-28 23:40:54

通过讨论 Windows-Mobile,我假设您使用的是 Compact Framework。

这是一篇有关如何在紧凑框架上调整图像大小的文章:http://channel9 .msdn.com/coding4fun/articles/Robs-Image-Shrinker

By taking about windows-mobile I assume you are on the Compact Framework.

Here is an article on how to resize images on the compact framework: http://channel9.msdn.com/coding4fun/articles/Robs-Image-Shrinker

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文