virtual L_INT LAnnStamp::SetBitmap(pBitmap, uFlags=0)
virtual L_INT LAnnStamp::SetBitmap(pBitmap, uFlags=0)
Sets the bitmap of the annotation object.
Pointer to the bitmap object referencing the bitmap object to assign to the specified object.
Pointer to the bitmap handle referencing the bitmap to assign to the specified object.
Flags that determine which objects to process. Most of the flags apply only to container objects. You can combine values when appropriate by using a bitwise OR ( | ). The following are valid values:
Value | Meaning |
---|---|
0 | Process only the specified object. |
ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the LAnnotation::IsSelected and LAnnotation::SetSelected functions. |
ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages. |
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
Win32, x64.
This is an example for LAnnStamp::SetBitmap(pBitmap, uFlags=0), with pBitmap of type pBITMAPHANDLE:
L_INT LAnnStamp_SetBitmapExample(HWND hWnd, pBITMAPHANDLE pBitmap, LAnnContainer * pAnnContainer, LAnnStamp * pAnnStamp)
{
L_INT nRet;
HDC hWindowDC; /* Device context of the current window */
ANNRECT ContainerRect; /* Root container's rectangle */
ANNRECT MyStampRect; /* Rectangle for the stamp object */
RECT rAnnBounds; /* Bounding rectangle used to draw the object */
/* Get the device context of the current window */
hWindowDC = GetDC (hWnd);
/* Get the container's rectangle */
nRet = pAnnContainer->GetRect(&ContainerRect);
if(nRet != SUCCESS)
return nRet;
/* Size and position the stamp, adjusting the height to keep the bitmap's aspect ratio */
MyStampRect.left = ContainerRect.right / 8;
MyStampRect.top = ContainerRect.bottom / 2;
MyStampRect.right = ContainerRect.right / 2;
MyStampRect.bottom = MyStampRect.top +
(((MyStampRect.right - MyStampRect.left) * BITMAPHEIGHT(pBitmap)) / BITMAPWIDTH(pBitmap));
nRet = pAnnStamp->SetRect(&MyStampRect);
if(nRet != SUCCESS)
return nRet;
/* Assign the bitmap to the stamp;*/
nRet = pAnnStamp->SetBitmap(pBitmap,0);
if(nRet != SUCCESS)
return nRet;
/* Display the stamp */
nRet = pAnnStamp->GetBoundingRect(&rAnnBounds);
if(nRet != SUCCESS)
return nRet;
nRet = pAnnStamp->Draw(hWindowDC, &rAnnBounds);
if(nRet != SUCCESS)
return nRet;
ReleaseDC(hWnd, hWindowDC);
/* Remove the queued paint message */
ValidateRect(hWnd, &rAnnBounds);
return SUCCESS;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document