Start with the project you created in Implementing Hit Testing.
Take the following steps to show/hide layers from a vector drawing:
Click the "Class View" tab of the project workspace.
Click to open the MyVectorWindow branch.
Double-click the MsgProcCallBack () member function.
Declare the following variables local to the MsgProcCallBack() function.
L_INT nIndex;
LVectorLayer Layer;
VECTORLAYERDESC LayerDesc;
Add the following code immediately before case 'b':
case '1':
case '2':
{
// get layer from index
if( wParam == '1' )
nIndex = 0;
else
nIndex = 1;
GetLayerByIndex (nIndex, &Layer );
// flip the visible state of the layer
Layer.GetLayerDesc (&LayerDesc);
LayerDesc.bVisible =!LayerDesc.bVisible;
Layer.SetLayerDesc (&LayerDesc);
InvalidateRect( hWnd, NULL, FALSE );
}
break;
Compile and run the demo.
The sample image (random.dxf) shipped with LEADTOOLS has 2 layers, you should be able to hide/show those layers by pressing 1 and 2 on your keyboard.
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document