GetExtents() Can not reduce the pic size?
Posted: 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
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