GetExtents() Can not reduce the pic size?

Discuss and ask questions about CAD VCL (Delphi and C++ Builder).

Moderators: SDS, support, admin

Post Reply
jasonz_2003
Posts: 24
Joined: 13 Apr 2006, 16:20

GetExtents() Can not reduce the pic size?

Post by jasonz_2003 » 19 May 2006, 07:24

Hi Sergey,

I have two questions. Please help.

First, I did some Entity moveing and rotate and use GetExtents() to adjust the pic size so the whole picture is visible. But I found the GetExtents() can only expand the Pic size, but does not reduce the size when the picture gets smaler. Is there somewhere else I can set(eg. sgPaintBox.Width etc.) to reduce FImg->Extents?

Second, I added a Line entitity of size (1000,600) to FImg1 and GetExtents() to expand its size then deleted the Line so it is not shown as the code follows. One of the problem I got is as above, I can not reduce the size anymore. Second problem is that once I run this code. I always get exception when I do sgPaintBox->Picture->Graphic = NULL, or sgPaintBox1->LoadFromFile(CurrFileName). Please guide me where the problem could be?

TsgDXFLine *ALine = new TsgDXFLine;
ALine->Point = MakeFPoint(0,0,0);
ALine->Point1 = MakeFPoint(CanvWidth, CanvHeight, 0);
FImg1->Converter->Sections[csEntities]->AddEntity(ALine);
if (FImg1->Converter->OnCreate != NULL)
FImg1->Converter->OnCreate(ALine);
FImg1->Converter->Loads(ALine);
// FImg1->ResetDrawingBox();
FImg1->GetExtents();
FImg1->Converter->DeleteEntity(ALine, true);

I am using C++ Builder 6.

Jason

support
Posts: 3256
Joined: 30 Mar 2005, 11:36
Contact:

Post by support » 19 May 2006, 14:47

Hi Jason,

<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">First, I did some Entity moveing and rotate and use GetExtents() to adjust the pic size so the whole picture is visible. But I found the GetExtents() can only expand the Pic size, but does not reduce the size when the picture gets smaler. Is there somewhere else I can set(eg. sgPaintBox.Width etc.) to reduce FImg->Extents?<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
It is really possible. The size can stay unchangeable. Everything depends on the drawing itself. For example when rotating sphere then the value of its diameter will stay the same. But when rotating plain drawing around any axis the size will be reducing.
<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Second, I added a Line entitity of size (1000,600) to FImg1 and GetExtents() to expand its size then deleted the Line so it is not shown as the code follows. One of the problem I got is as above, I can not reduce the size anymore. Second problem is that once I run this code. I always get exception when I do sgPaintBox->Picture->Graphic = NULL, or sgPaintBox1->LoadFromFile(CurrFileName). Please guide me where the problem could be?<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
We need the whole code which calls exception. If possible please send your demo application on support@cadsofttols.com.

Sergey.

please post questions to the forum or write to support@cadsofttools.com

Post Reply