如何将捕获的图像(用相机)缩放到特定PictureBox的大小?
我想缩放捕获的图像并将其显示在我在表单中找到的图片框中。
当我这样做时(其中 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过讨论 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