Graphics object
Posted: 08 Oct 2009, 13:27
Hi there.
I am considering your dll DXFExport for my project.
I have found a problem that may be related to your MetaForm or perhaps its just me misunderstanding the use.
In my project i have a picture that may change dynamically, and in that case it needs to be repainted.
I cannot make the MetaForm.Graphics to paint my nice picture until i call Dispose on it, like in your demo.
But i do not want to Dispose it for every repaint, because then i have to recreate the Metaform and it seems inefficient to do this.
How do you suggest to use it when a form needs to be repainted frequently?
Best Regard,
I am considering your dll DXFExport for my project.
I have found a problem that may be related to your MetaForm or perhaps its just me misunderstanding the use.
In my project i have a picture that may change dynamically, and in that case it needs to be repainted.
I cannot make the MetaForm.Graphics to paint my nice picture until i call Dispose on it, like in your demo.
But i do not want to Dispose it for every repaint, because then i have to recreate the Metaform and it seems inefficient to do this.
How do you suggest to use it when a form needs to be repainted frequently?
Code: Select all
private void frmPage_Paint(object sender, PaintEventArgs e)
{
if (mf1 == null) mf1 = new MetaForm(this, EmfType.EmfPlusDual, true);
Page.Draw(ref mf1.mfGraph);
mf1.mfGraph.Dispose(); //Here my graphics are actually painted, but i do not want to Dispose it.
}