ImageGear for C and C++ on Windows v19.3 - Updated
ART_edit_copy
API Reference Guide > ART Component API Reference > ART Component Functions Reference > Edit Clipboard Functions > ART_edit_copy

This function copies an array of marks and places them on the clipboard.

Declaration:

 
Copy Code
AT_ERRCOUNT ART_edit_copy(
        HIGEAR hIGear, 
        LPART_MARK_INDEX lpMarkIndex, 
        DWORD dwMarkCount
);

Arguments:

Name Type Description
hIGear HIGEAR HIGEAR handle to the image.
lpMarkIndex LPART_MARK_INDEX A far pointer to an array list of mark identifiers.
dwMarkCount DWORD A variable of type DWORD which tells ART the number of marks to copy to the clipboard. This number indicates the number of mark indexes in the lpMarkIndex array.

Return Value:

Returns the number of ImageGear errors that occurred during the function call.

Supported Raster Image Formats:

All pixel formats supported by ImageGear for C and C++.

Sample:

Annotation

Example:

 
Copy Code
HIGEAR hIGear; /* HIGEAR handle of image */
ERRCOUNT nErrcount; /* tally of IG errors on the */ 
/* stack   */
ART_MARK_INDEX lpMarkIndex; /* number of mark(s) */ 
/* to copy toclipboard */
DWORD dwMarkCount; /* # of marks that have been */ 
/* selected  */
HGLOBAL hGlobal; /* Windows handle to memory */
/* area   */
. . .
case ID_EDIT_COPY:
nErrcount = ART_mark_select_count(hIGear,
   &dwMarkCount);
hGlobal = GlobalAlloc(GMEM_MOVEABLE, dwMarkCount *
sizeof(ART_MARK_INDEX));
lpMarkIndex=(LPART_MARK_INDEX)GlobalLock(hGlobal);
nErrcount = 
ART_mark_selected_first(hIGear,lpMarkIndex);
for (i = 1; i < (INT)dwMarkCount; i++)
{
lpMarkIndex[i] = lpMarkIndex[i - 1];
nErrcount = ART_mark_selected_next(hIGear, 
lpMarkIndex + i);
}
nErrcount = ART_edit_copy(hIGear, lpMarkIndex, 
dwMarkCount);
GlobalUnlock(hGlobal);
GlobalFree(hGlobal);
break;

Remarks:

An error is set if any of the following conditions are met: