LImageViewerCell::FlipAnnotationContainer

#include "ltwrappr.h"

L_INT LImageViewerCell::FlipAnnotationContainer(nSubCellIndex, uFlags)

L_INT nSubCellIndex;

/* index into the image list attached to the cell */

L_UINT uFlags;

/* reserved for future */

Flips the annotation container.

Parameter

Description

nSubCellIndex

A zero-based index into the image list attached to the cell. This sub-cell contains the image that contains the annotation container. Pass -2 to refer to the selected sub-cell.

uFlags

Reserved for future use. Pass 0.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

This function only flips the annotation container. It doesn't flip the image itself.

Required DLLs and Libraries

LTIVW

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LImageViewerCell::RotateAnnotationContainer, LImageViewerCell::ReverseAnnotationContainer, LImageViewerCell::GetAnnotationContainer, LImageViewerCell::SetAnnotationContainer, LImageViewerCell::AnnToRgn, LImageViewerCell::GetSelectedAnnotationAttributes, LImageViewerCell::EnableAnnotationCallBack, LImageViewerCell::EnableAnnotationCreatedCallBack, LImageViewerCell::AnnotationCreatedCallBack, LImageViewerCell::AnnotationCallBack, Class Members

Topics:

Working with Annotations

 

Window Control/Image Viewer Functions: Annotations

Example

This example will flip the image along with the annotation container if the user click on the image using the left mouse button, and will reservse on the right mouse button, and will rotate on the middle mouse button.

#if defined LTV17_CONFIG
class LImageViewerChild3 :public LImageViewerCell
{
   virtual L_INT MouseCallBack(L_UINT                 uMessage,
                                 pDISPCONTAINERCELLINFO pCellInfo);
} ; 
L_INT LImageViewerChild3::MouseCallBack(L_UINT                 uMessage,
                                       pDISPCONTAINERCELLINFO pCellInfo)
{
   UNREFERENCED_PARAMETER(pCellInfo);
   BITMAPHANDLE Bitmap;
   LBitmap BitmapHandle;
   pBITMAPHANDLE pBitmap;
   switch(uMessage)
   {
   case WM_LBUTTONUP:
      {
         GetBitmapHandle(pCellInfo->nSubCellIndex, &Bitmap, 0);
         BitmapHandle.SetHandle(&Bitmap);
         BitmapHandle.Flip();
         pBitmap = BitmapHandle.GetHandle();
         SetBitmapHandle(pCellInfo->nSubCellIndex, pBitmap, TRUE, 0);
         BitmapHandle.SetHandle(NULL, FALSE);
         FlipAnnotationContainer(pCellInfo->nSubCellIndex, 0);
      }
      break;
   case WM_MBUTTONUP:
         GetBitmapHandle(pCellInfo->nSubCellIndex, &Bitmap, 0);
         BitmapHandle.SetHandle(&Bitmap);
         BitmapHandle.Reverse();
         pBitmap = BitmapHandle.GetHandle();
         SetBitmapHandle(pCellInfo->nSubCellIndex, pBitmap, TRUE, 0);
         BitmapHandle.SetHandle(NULL, FALSE);
         ReverseAnnotationContainer(pCellInfo->nSubCellIndex, 0);
      break;
   case WM_RBUTTONUP:
         L_INT    nAngle;
         RotateBitmapPerspective(pCellInfo->nSubCellIndex, 90, 0);
         GetRotateBitmapPerspectiveAngle(pCellInfo->nSubCellIndex, &nAngle, 0);
         RotateAnnotationContainer(pCellInfo->nSubCellIndex, nAngle, 0);
      break;
   }
   return SUCCESS;
}
L_INT LImageViewer_FlipAnnotationContainerExample(LImageViewerCell& ImageViewerCell)
{
   ImageViewerCell.EnableMouseCallBack(TRUE);
   return SUCCESS;
}
#else
class LImageViewerChild3 :public LImageViewer
{
   virtual L_INT MouseCallBack(L_UINT                 uMessage,
                                 pDISPCONTAINERCELLINFO pCellInfo);
} ; 
L_INT LImageViewerChild3::MouseCallBack(L_UINT                 uMessage,
                                       pDISPCONTAINERCELLINFO pCellInfo)
{
   UNREFERENCED_PARAMETER(pCellInfo);
   BITMAPHANDLE Bitmap;
   LBitmap BitmapHandle;
   pBITMAPHANDLE pBitmap;
   switch(uMessage)
   {
   case WM_LBUTTONUP:
      {
         GetBitmapHandle( pCellInfo->nCellIndex, pCellInfo->nSubCellIndex, &Bitmap, 0);
         BitmapHandle.SetHandle(&Bitmap);
         BitmapHandle.Flip();
         pBitmap = BitmapHandle.GetHandle();
         SetBitmapHandle( pCellInfo->nCellIndex, pCellInfo->nSubCellIndex, pBitmap, TRUE, 0);
         BitmapHandle.SetHandle(NULL, FALSE);
         FlipAnnotationContainer( pCellInfo->nCellIndex, pCellInfo->nSubCellIndex, 0);
      }
      break;
   case WM_MBUTTONUP:
         GetBitmapHandle( pCellInfo->nCellIndex, pCellInfo->nSubCellIndex, &Bitmap, 0);
         BitmapHandle.SetHandle(&Bitmap);
         BitmapHandle.Reverse();
         pBitmap = BitmapHandle.GetHandle();
         SetBitmapHandle( pCellInfo->nCellIndex, pCellInfo->nSubCellIndex, pBitmap, TRUE, 0);
         BitmapHandle.SetHandle(NULL, FALSE);
         ReverseAnnotationContainer( pCellInfo->nCellIndex, pCellInfo->nSubCellIndex, 0);
      break;
   case WM_RBUTTONUP:
         L_INT    nAngle;
         RotateBitmapPerspective( pCellInfo->nCellIndex, pCellInfo->nSubCellIndex, 90, 0);
         GetRotateBitmapPerspectiveAngle( pCellInfo->nCellIndex, pCellInfo->nSubCellIndex, &nAngle, 0);
         RotateAnnotationContainer( pCellInfo->nCellIndex, pCellInfo->nSubCellIndex, nAngle, 0);
      break;
   }
   return SUCCESS;
}
L_INT LImageViewer_FlipAnnotationContainerExample(LImageViewer& ImageViewer)
{
   ImageViewer.EnableMouseCallBack(TRUE);
   return SUCCESS;
}
#endif // LTV17_CONFIG