The example is made on the basis of the Viewer demo:
procedure TForm3.btnSwitchLayerOnOffClick(Sender: TObject);
var
I: Integer;
vRect: TRect;
begin
if FImg = nil then
Exit;
for I := 0 to FImg.Converter.Counts[csLayers] - 1 do
begin
if TsgDXFLayer(FImg.Converter.Sections[csLayers].Entities[I]).Name = 'Sracka' then
TsgDXFLayer(FImg.Converter.Sections[csLayers].Entities[I]).Frozen := not TsgDXFLayer(FImg.Converter.Sections[csLayers].Entities[I]).Frozen;
end;
vRect.TopLeft := FImg.GetPoint(MakeFPoint(136.496, 142.4254,0));
vRect.BottomRight := FImg.GetPoint(MakeFPoint(198.8186, 163.4130,0));
vRect.Left := vRect.Left + sgImage1.Left;
vRect.Right := vRect.Right + sgImage1.Left + 1;
vRect.Top := vRect.Top + sgImage1.Top + 1;
vRect.Bottom := vRect.Bottom + sgImage1.Top;
InvalidateRect(sgImage1.Parent.Handle, @vRect,false);
UpdateWindow(sgImage1.Parent.Handle)
end;
Go to CAD VCL Enterprise