Windows窗体中C#中的图像 [英] image in C# in windows forms

查看:88
本文介绍了Windows窗体中C#中的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!)
很抱歉,英语扭曲了.
请提示我,有什么方法可以在设置的大小的平方上执行图像划分,例如在10rkh上执行?然后可以定义图像这些部分的颜色吗?
在Windows窗体上的C#

hello!)
I am sorry for the twisted English)
Prompt me, please, what methods it is possible to execute the division of image on the squares of the set size, for example on 10rkh? And as is it then possible to define the color of these parts of image?
Project on Windows Forms on C#

推荐答案

上,该问题根本不清楚(请参阅我对问题的评论),但是在所有此类情况下,您都应使用System.Drawing.BitmapSystem.Drawing.Bitmap.LockBits以访问图像数据.

参见代码示例: http://msdn.microsoft.com/en -us/library/system.drawing.bitmap.lockbits.aspx [ ^ ].

由于性能问题,除非所有像素大约只有几个像素,否则应避免使用GetPixel/SetPixel.

另请参阅本文以获取详细说明: http://www.bobpowell.net/lockingbits.htm [ ^ ].

—SA
The question is not clear at all (please see my comments to the question), but in all such cases you should work using System.Drawing.Bitmap and System.Drawing.Bitmap.LockBits to access image data.

See this, with code samples: http://msdn.microsoft.com/en-us/library/system.drawing.bitmap.lockbits.aspx[^].

Due to performance issues, you should avoid using GetPixel/SetPixel by all means, unless this is just a couple pixels or so.

See also this article for the detailed explanations: http://www.bobpowell.net/lockingbits.htm[^].

—SA


我想获得该正方形的原色,该颜色在当前正方形中最多.这样可能吗?
I want to get a primary color for this square, that color which most in a current square. is such possible?


这篇关于Windows窗体中C#中的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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