How to copy a TsgDXFImage
Moderators: SDS, support, admin
How to copy a TsgDXFImage
Dear Sergey,
I am trying to make a copy of an already loaded TsgDXFImage so that I can keep a snapshot of the drawing before the user has done any changes onto it ! I have used BaseImg.Assign(TsgDXFImage(sgPaintBox.Picture.Graphic)) but instead of making a copy of it, BaseImg refers to the original image, thus, when I try to revert to it, I get the changed image. I do not want to use the LoadFromFile method since the file is quite big and it takes some time to load it.
Thanks in advance
George
I am trying to make a copy of an already loaded TsgDXFImage so that I can keep a snapshot of the drawing before the user has done any changes onto it ! I have used BaseImg.Assign(TsgDXFImage(sgPaintBox.Picture.Graphic)) but instead of making a copy of it, BaseImg refers to the original image, thus, when I try to revert to it, I get the changed image. I do not want to use the LoadFromFile method since the file is quite big and it takes some time to load it.
Thanks in advance
George
Hello George,
Thank you for the question.
<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">"BaseImg refers to the original image"<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
It is not exactly that. Reference is the same for Converter only. It means that you can change TsgDXFImage properties (background color, rotation, visibility of texts and dimensions etc.) but you can't change entities independently for different copies of TsgDXFImage class object. Using current version of CADImportVCL it is necessary to load CAD file several times in need to store several independent copies of TsgDXFImage class object. One of the reasons of this rule is a necessity to set inner references between objects of the loaded CAD file.
Sergey.
please post questions to the forum or write to support@cadsofttools.com
Thank you for the question.
<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">"BaseImg refers to the original image"<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
It is not exactly that. Reference is the same for Converter only. It means that you can change TsgDXFImage properties (background color, rotation, visibility of texts and dimensions etc.) but you can't change entities independently for different copies of TsgDXFImage class object. Using current version of CADImportVCL it is necessary to load CAD file several times in need to store several independent copies of TsgDXFImage class object. One of the reasons of this rule is a necessity to set inner references between objects of the loaded CAD file.
Sergey.
please post questions to the forum or write to support@cadsofttools.com