ShowRotateDlg Example for Visual Basic

Private Sub Rotate_Click()
	Dim RasterImgDlg   As New LEADRasterDlgImg_U
	Dim RasterKrnDlg As New LEADRasterDlgKrn_U
	Dim nRet As Integer

	RasterKrnDlg.InitDlg 0
	RasterImgDlg.EnableZoomToFit = False
	RasterImgDlg.BackColor = RGB(255, 0, 0)
	RasterImgDlg.Bitmap = LEAD1.Bitmap
	RasterImgDlg.UIFlags = ROTATE_SHOW_PREVIEW Or _
							   ROTATE_SHOW_BACKCOLOR Or _
							   ROTATE_SHOW_RESIZE

	RasterImgDlg.EnableMethodErrors = False
	RasterImgDlg.ShowHelpButton = True

	nRet = RasterImgDlg.ShowRotateDlg(hWnd)
	If (nRet = 0 And RasterImgDlg.DialogStatus = DLG_OK) Then
		LEAD1.Rotate RasterImgDlg.Angle, RasterImgDlg.RotateFlags, RasterImgDlg.BackColor
	End If
	RasterKrnDlg.FreeDlg
End Sub