本文整理汇总了C#中UnmanagedImage.Copy方法的典型用法代码示例。如果您正苦于以下问题:C# UnmanagedImage.Copy方法的具体用法?C# UnmanagedImage.Copy怎么用?C# UnmanagedImage.Copy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnmanagedImage
的用法示例。
在下文中一共展示了UnmanagedImage.Copy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessFilter
/// <summary>
/// Process the filter on the specified image.
/// </summary>
///
/// <param name="sourceData">Source image data.</param>
/// <param name="destinationData">Destination image data.</param>
///
protected override void ProcessFilter(UnmanagedImage sourceData, UnmanagedImage destinationData)
{
if (sourceData.PixelFormat == PixelFormat.Format8bppIndexed)
sourceData = toRGB.Apply(sourceData);
// Copy image contents
sourceData.Copy(destinationData);
Bitmap managedImage = destinationData.ToManagedImage(makeCopy: false);
using (Graphics g = Graphics.FromImage(managedImage))
using (Pen positive = new Pen(Color.Red))
using (Pen negative = new Pen(Color.Blue))
using (Pen line = new Pen(Color.FromArgb(0, 255, 0)))
{
// mark all points
foreach (SpeededUpRobustFeaturePoint p in points)
{
int S = (int)(scale * p.Scale);
int R = (int)(S / 2f);
Point pt = new Point((int)p.X, (int)p.Y);
Point ptR = new Point((int)(R * System.Math.Cos(p.Orientation)),
(int)(R * System.Math.Sin(p.Orientation)));
Pen myPen = (p.Laplacian > 0 ? negative : positive);
g.DrawEllipse(myPen, pt.X - R, pt.Y - R, S, S);
g.DrawLine(line, new Point(pt.X, pt.Y), new Point(pt.X + ptR.X, pt.Y + ptR.Y));
}
}
}