本文整理匯總了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;
}
}