我怎样才能调整在C#中的形象呢? [英] How I can resize the image in c#?

查看:102
本文介绍了我怎样才能调整在C#中的形象呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个形象

image = Image.FromStream(file.InputStream);

我如何使用属性 System.Drawing.Size 的调整它们的大小或者用于此属性?

How I can use the property System.Drawing.Size for resize them or where this property used for?

我可以直接调整,而不将其更改为位图或没有损失任何品质的形象。我不想只是总公司调整它们。

Can I direct resize the image without change them to bitmap or without loss any quality. I not want corp just resize them.

我如何在C#这样做吗?

How I can do this in C#?

推荐答案

您可以使用位图类的构造函数来帮助,实际上是位图图像的子类。

You can use Bitmap class's constructor to help, and actually Bitmap is a subclass of Image.

var image_16 = new System.Drawing.Bitmap(image, new Size(16, 16));

在参考 - http://msdn.microsoft.com /en-us/library/system.drawing.size.aspx

更提前GDI +技术能够找到

more advance by GDI+ technique able to find at

HTTP://www.$c$cproject.com/ KB / GDI加/ imageresize.aspx

这篇关于我怎样才能调整在C#中的形象呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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