LPaint::FrameRgn

#include "ltwrappr.h"

virtual L_INT LPaint::FrameRgn(uType, pXForm=NULL)

Displays an outline of the class object's associated bitmap region. If the region includes noncontiguous shapes, each shape is outlined. The outline, itself, is inside the region.

Parameters

L_UINT uType

The type of frame to display. The following are possible values. To animate the frame, you must cycle through the values using a timer event.

Value Number
L_FRAME_MOVING0 [0]
L_FRAME_MOVING1 [1]
L_FRAME_MOVING2 [2]
L_FRAME_MOVING3 [3]
L_FRAME_MOVING4 [4]
L_FRAME_MOVING5 [5]
L_FRAME_MOVING6 [6]
L_FRAME_MOVING7 [7]

pRGNXFORM pXForm

Pointer to an RGNXFORM structure that LEADTOOLS uses to translate between display coordinates and bitmap coordinates.

If you specify NULL in this parameter, the scalar fields default to 1, the offsets default to 0, and the view perspective defaults to the bitmap's view perspective.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

Before calling this function, you must declare an RGNXFORM structure and set its values, which LEADTOOLS uses to translate between device context coordinates and bitmap coordinates. For details about how the structure works refer to the RGNXFORM structure description. For a description of common usage, refer to Translating Coordinates for a Bitmap Region.

This function is designed to produce an animated frame, which you can implement by calling the function with a timer event that cycles through the possible frame types.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

L_INT LPaint__FrameRgnExample(HWND hWnd) 
{ 
   L_INT nRet; 
   LPaint LeadPaint ; 
   LBitmapRgn LeadRegion; 
   LBitmapBase LeadBitmap; 
   RGNXFORM Xform; 
   HDC hDC; 
   RECT Rect, rClientArea ; 
 
   nRet = LeadBitmap.Load(MAKE_IMAGE_PATH(TEXT("image1.cmp"))) ; 
   if(nRet != SUCCESS) 
      return nRet; 
 
   LeadRegion.SetBitmap(&LeadBitmap) ; 
 
   Rect.left = 10 ; 
   Rect.top = 10 ; 
   Rect.right = 50 ; 
   Rect.bottom = 50 ; 
 
   nRet = LeadRegion.SetRgnRect(&Rect); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   hDC = GetDC(hWnd) ; 
 
   // Get the client area of the current window 
   GetClientRect(hWnd,&rClientArea); 
 
   LeadRegion.GetRgnXForm(&Xform); 
   LeadPaint.SetBitmap(&LeadBitmap); 
   LeadPaint.SetDC(hDC) ; 
 
   Xform.uViewPerspective = TOP_LEFT; 
   Xform.nXScalarNum = LeadBitmap.GetWidth(); 
   Xform.nXScalarDen = rClientArea.right; 
   Xform.nYScalarNum = LeadBitmap.GetHeight() ; 
   Xform.nYScalarDen = rClientArea.bottom; 
   Xform.nXOffset = 0; 
   Xform.nYOffset = 0; 
 
   nRet = LeadPaint.FrameRgn(L_FRAME_MOVING0,&Xform) ; 
   if(nRet != SUCCESS) 
      return nRet; 
 
   nRet = LeadPaint.PaintRgnDC() ; 
   if(nRet != SUCCESS) 
      return nRet; 
 
   LeadPaint.SetDC(0) ; 
   ReleaseDC(hWnd,hDC); 
 
   return SUCCESS; 
} 
Help Version 22.0.2021.9.12
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help