本文整理汇总了C#中IImageByte.GetRecieveBlender方法的典型用法代码示例。如果您正苦于以下问题:C# IImageByte.GetRecieveBlender方法的具体用法?C# IImageByte.GetRecieveBlender怎么用?C# IImageByte.GetRecieveBlender使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IImageByte
的用法示例。
在下文中一共展示了IImageByte.GetRecieveBlender方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CopyFrom
public void CopyFrom(IImageByte sourceImage)
{
Allocate(sourceImage.Width, sourceImage.Height, sourceImage.StrideInBytesAbs(), sourceImage.BitDepth);
// make sure we make an exact copy
SetRecieveBlender(new BlenderBGRAExactCopy());
CopyFrom(sourceImage, sourceImage.GetBounds(), 0, 0);
// then set the blender to what we expect
SetRecieveBlender(sourceImage.GetRecieveBlender());
}
示例2: NewSubImageReference
/// <summary>
/// This will create a new ImageBuffer that references the same memory as the image that you took the sub image from.
/// It will modify the original main image when you draw to it.
/// </summary>
/// <param name="imageContainingSubImage"></param>
/// <param name="subImageBounds"></param>
/// <returns></returns>
public static ImageBuffer NewSubImageReference(IImageByte imageContainingSubImage, RectangleDouble subImageBounds)
{
ImageBuffer subImage = new ImageBuffer();
if (subImageBounds.Left < 0 || subImageBounds.Bottom < 0 || subImageBounds.Right > imageContainingSubImage.Width || subImageBounds.Top > imageContainingSubImage.Height
|| subImageBounds.Left >= subImageBounds.Right || subImageBounds.Bottom >= subImageBounds.Top)
{
throw new ArgumentException("The subImageBounds must be on the image and valid.");
}
int left = Math.Max(0, (int)Math.Floor(subImageBounds.Left));
int bottom = Math.Max(0, (int)Math.Floor(subImageBounds.Bottom));
int width = Math.Min(imageContainingSubImage.Width - left, (int)subImageBounds.Width);
int height = Math.Min(imageContainingSubImage.Height - bottom, (int)subImageBounds.Height);
int bufferOffsetToFirstPixel = imageContainingSubImage.GetBufferOffsetXY(left, bottom);
subImage.AttachBuffer(imageContainingSubImage.GetBuffer(), bufferOffsetToFirstPixel, width, height, imageContainingSubImage.StrideInBytes(), imageContainingSubImage.BitDepth, imageContainingSubImage.GetBytesBetweenPixelsInclusive());
subImage.SetRecieveBlender(imageContainingSubImage.GetRecieveBlender());
return subImage;
}