本文整理汇总了C#中IImage.Draw方法的典型用法代码示例。如果您正苦于以下问题:C# IImage.Draw方法的具体用法?C# IImage.Draw怎么用?C# IImage.Draw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IImage
的用法示例。
在下文中一共展示了IImage.Draw方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawImageAlphaChannel
public static void DrawImageAlphaChannel(this Graphics gx, IImage image, Rectangle dest)
{
Rectangle rc = new Rectangle(dest.X, dest.Y, dest.Width + dest.X, dest.Height + dest.Y);
IntPtr hdc = gx.GetHdc();
image.Draw(hdc, ref rc, IntPtr.Zero);
gx.ReleaseHdc(hdc);
}
示例2: DrawImageAlphaChannelTiled
public void DrawImageAlphaChannelTiled(IImage image, int x, int y, bool horizontal, int maxwidth)
{
ImageInfo imageInfo = new ImageInfo();
image.GetImageInfo(out imageInfo);
if (horizontal)
{
int width = Math.Max((int)imageInfo.Width, maxwidth);
Rectangle rc = new Rectangle(x, y, x + width, (int)imageInfo.Height + y);
image.Draw(_hdc, ref rc, IntPtr.Zero);
}
else
{
throw new NotImplementedException();
}
}
示例3: DrawImageAlphaChannel
public void DrawImageAlphaChannel(IImage image, Rectangle dest)
{
Rectangle rc = new Rectangle(dest.X, dest.Y, dest.Width + dest.X, dest.Height + dest.Y);
image.Draw(_hdc, ref rc, IntPtr.Zero);
}
示例4: CreateBitmapFromIImage
private Bitmap CreateBitmapFromIImage(IImage image)
{
Bitmap result = null;
if (image != null)
{
ImageInfo ii;
image.GetImageInfo(out ii);
result = new Bitmap((int)ii.Width, (int)ii.Height);
using (Graphics gr = Graphics.FromImage(result))
{
IntPtr hdc = gr.GetHdc();
Rectangle rect = new Rectangle(0, 0, result.Width, result.Height);
image.Draw(hdc, ref rect, IntPtr.Zero);
gr.ReleaseHdc(hdc);
}
}
return result;
}