如何在PictureBox中缩放绘制的图像 [英] How to Zoom a Drawn Image in PictureBox

查看:122
本文介绍了如何在PictureBox中缩放绘制的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,C#.Net中的一个新人.

我需要将使用gdi +绘制的图像缩放到pictureBox.

我进行了搜索,但是找不到一个好的答案,我发现的只是存在的文件.
有谁有主意吗?

感谢您的回答.

我最好的问候...

Hey everyone, a new guy here in C#.Net.

What I need is to zoom an image drawn using gdi+ to pictureBox.

I searched but couldn''t find a nice answer, all I found was for existing files.
Does anyone has an idea?

Thanks for the answers.

My best Regards...

推荐答案

希望 [ ^ ]可能


您可以在设备上下文上执行GDI操作后绘制图像.因此图像将相应缩放.

这是一个例子

使图像适合于图片框,缩放和移动 [ ^ ]

转换设备上下文后绘制图像.

祝您好运
You can draw the image after your GDI operations on the device context. So the image will be scaled accordingly.

here is an example

Have an Image fit to picturebox, zoom and move[^]

It draws the image after transforming the device context.

Good luck


在这种情况下,您可能会或可能不会使用PictureBox,这取决于您的其他功能.
无论如何,您可以在没有PictureBox的情况下获得任何功能,但反之则不能,因此至少应考虑以下替代方法:

请在这里查看我最近的答案:
C#图片框的不透明度 [
You may or may not use PictureBox in this case, depending on your other functions.
Anyway, you can get any functionality without PictureBox, but not visa versa, so you should at least consider the alternative:

Please see my recent answer here:
C# Opacity Of Picturebox[^].

Good luck,
—SA


这篇关于如何在PictureBox中缩放绘制的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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