Text Justification
Moderators: SDS, support, admin
Re: Text Justification
Well, no, because I would like to let the Draw method to stay ignorant of exactly which Graphics object that it was drawing itself to. In this way, I can use the same Draw method for both screen representation and "DXFPrint". This was possible in the older versions.
Best Regards,
Best Regards,
Re: Text Justification
Hello.
You transfer Grahics object to your Draw method as a parameter. As I see it, nothing oppose to transfer one Graphics object or another not as the reference.
What's the difference?
Alexander.
You transfer Grahics object to your Draw method as a parameter. As I see it, nothing oppose to transfer one Graphics object or another not as the reference.
What's the difference?
Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: Text Justification
OK, maybe I am not the expert, but I fail see how.
The Draw function must have a defined signature.
See my pseudocode below(this was possible in your prior versions):
PrintToDXF()
{
yourClassNameThatIDoNotRememberTheNameOf mf1;
Draw(ref mf1.Graphics);
}
PrintToScreen()
{
Graphics g = e.Graphics;
Draw(ref g);
}
Draw(ref Graphics gr)
{
gr.DrawString("abc");
}
Anyhow, I am now doubling my draw() functions, one for DXF and one for Screen. I hate to double the code, but I cannot find away around it.
Best regads,
The Draw function must have a defined signature.
See my pseudocode below(this was possible in your prior versions):
PrintToDXF()
{
yourClassNameThatIDoNotRememberTheNameOf mf1;
Draw(ref mf1.Graphics);
}
PrintToScreen()
{
Graphics g = e.Graphics;
Draw(ref g);
}
Draw(ref Graphics gr)
{
gr.DrawString("abc");
}
Anyhow, I am now doubling my draw() functions, one for DXF and one for Screen. I hate to double the code, but I cannot find away around it.
Best regads,
Re: Text Justification
Did you try to modify your pseudocode like following?
Alexander.
Code: Select all
PrintToDXF()
{
MetaForm mf1;
Draw(mf1.Graphics);
}
PrintToScreen()
{
Draw(e.Graphics);
}
Draw(Graphics gr)
{
gr.DrawString("abc");
}
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: Text Justification
Please post your questions if any with detailed description to the forum or send to support@cadsofttools.com.
Alexander.
Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support