Start with the project you created in Vector Load and Save.
Add this local variable under L_INT nRet; in the WndProc function:
VECTORPOINT Point; Add these cases under the WM_COMMAND case:
case WM_CHAR:switch( wParam ){case 'x':case 'X':case 'y':case 'Y':case 'z':case 'Z':// get current rotation valueL_VecGetRotation ( &Vector, &Point );Point.x += ( wParam == 'x' || wParam == 'X' ) ? 5.0 : 0;Point.y += ( wParam == 'y' || wParam == 'Y' ) ? 5.0 : 0;Point.z += ( wParam == 'z' || wParam == 'Z' ) ? 5.0 : 0;// set new rotation valueL_VecSetRotation ( &Vector, &Point, NULL, NULL, 0 );InvalidateRect( hWnd, NULL, FALSE );break;case '+':case '-':// get current scale valueL_VecGetScale ( &Vector, &Point );Point.x += ( wParam == '+' ) ? 0.1 : -0.1;Point.y += ( wParam == '+' ) ? 0.1 : -0.1;Point.z += ( wParam == '+' ) ? 0.1 : -0.1;// set new scale valueL_VecSetScale ( &Vector, &Point, NULL, NULL, 0 );InvalidateRect( hWnd, NULL, FALSE );break;}break;case WM_KEYDOWN:switch( wParam ){case VK_UP:case VK_DOWN:case VK_LEFT:case VK_RIGHT:// get current translationL_VecGetTranslation ( &Vector, &Point );if( wParam == VK_LEFT ) Point.x -= 1.0;if( wParam == VK_RIGHT ) Point.x += 1.0;if( wParam == VK_UP ) Point.y += 1.0;if( wParam == VK_DOWN ) Point.y -= 1.0;// set new translation valueL_VecSetTranslation ( &Vector, &Point, NULL, 0 );InvalidateRect( hWnd, NULL, FALSE );break;}break;
Compile and run the demo.
Select File/Open from the program menu. Browse to C:\LEADTOOLS23\Resources\Images\random.dxf and click OK.
Now you should be able to rotate the vector drawing around any axis using the x, y and z keys on your keyboard and scale up and down using the + and keys.