本文整理汇总了C#中System.Drawing.Graphics.EnumerateMetafile方法的典型用法代码示例。如果您正苦于以下问题:C# Graphics.EnumerateMetafile方法的具体用法?C# Graphics.EnumerateMetafile怎么用?C# Graphics.EnumerateMetafile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Drawing.Graphics
的用法示例。
在下文中一共展示了Graphics.EnumerateMetafile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessEMF
public void ProcessEMF(byte[] emf)
{
try
{
_ms = new MemoryStream(emf);
_mf = new Metafile(_ms);
_bm = new Bitmap(1, 1);
g = Graphics.FromImage(_bm);
//XScale = Width / _mf.Width;
//YScale = Height/ _mf.Height;
m_delegate = new Graphics.EnumerateMetafileProc(MetafileCallback);
g.EnumerateMetafile(_mf, new Point(0, 0), m_delegate);
}
finally
{
if (g != null)
g.Dispose();
if (_bm != null)
_bm.Dispose();
if (_ms != null)
{
_ms.Close();
_ms.Dispose();
}
}
}
示例2: ReportDrawPage
// Method to draw the current emf memory stream
private void ReportDrawPage(Graphics graphics)
{
if (m_currentPageStream == null || m_currentPageStream.Length == 0 || m_metafile == null)
return;
// Set metafile delegate.
m_delegate = new Graphics.EnumerateMetafileProc(MetafileCallback);
// Draw in the rectangle
Point destPoint = new Point(0, 0);
graphics.EnumerateMetafile(m_metafile, destPoint, m_delegate);
// Clean up
m_delegate = null;
}
示例3: ReportDrawPage
// Method to draw the current emf memory stream
private void ReportDrawPage(Graphics g)
{
if (null == m_currentPageStream || 0 == m_currentPageStream.Length || null == m_metafile)
return;
lock (this)
{
// Set the metafile delegate.
int width = m_metafile.Width;
int height = m_metafile.Height;
m_delegate = new Graphics.EnumerateMetafileProc(MetafileCallback);
// Draw in the rectangle
Point[] points = new Point[3];
Point destPoint = new Point(0, 0);
Point destPoint1 = new Point(width, 0);
Point destPoint2 = new Point(0, height);
points[0] = destPoint;
points[1] = destPoint1;
points[2] = destPoint2;
g.EnumerateMetafile(m_metafile, points, m_delegate);
// Clean up
m_delegate = null;
}
}