本文整理汇总了C#中IBitmap.GetPixel方法的典型用法代码示例。如果您正苦于以下问题:C# IBitmap.GetPixel方法的具体用法?C# IBitmap.GetPixel怎么用?C# IBitmap.GetPixel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IBitmap
的用法示例。
在下文中一共展示了IBitmap.GetPixel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RGBLuminanceSource
public RGBLuminanceSource(IBitmap d, int W, int H)
: base(W, H) {
int width = __width = W;
int height = __height = H;
// In order to measure pure decoding speed, we convert the entire image to a greyscale array
// up front, which is the same as the Y channel of the YUVLuminanceSource in the real app.
luminances = new sbyte[width * height];
//if (format == PixelFormat.Format8bppIndexed)
{
Color c;
for (int y = 0; y < height; y++) {
int offset = y * width;
for (int x = 0; x < width; x++) {
c = d.GetPixel(x, y);
luminances[offset + x] = (sbyte)(((int)c.R) << 16 | ((int)c.G) << 8 | ((int)c.B));
}
}
}
}
示例2: manipulateImage
private void manipulateImage(IBitmap bitmap, ILoadImageConfig config)
{
if (config == null) return;
if (config.TransparentColorSamplePoint != null)
{
Color transparentColor = bitmap.GetPixel((int)config.TransparentColorSamplePoint.Value.X,
(int)config.TransparentColorSamplePoint.Value.Y);
bitmap.MakeTransparent(transparentColor);
}
}