Start with the project you created in Implementing Hit Testing.
Take the following steps to show/hide layers from a vector drawing:
1. |
Click the "Class View" tab of the project workspace. |
2. |
Click to open the MyVectorWindow branch. |
3. |
Double-click the MsgProcCallBack () member function. |
4. |
Declare the following variables local to the MsgProcCallBack() function. |
L_INT nIndex;
LVectorLayer Layer;
VECTORLAYERDESC LayerDesc;
5. |
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;
6. |
Compile and run the demo. |
7. |
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. |
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.