Specifies whether the ReportListener will be passed a handle to the image source when the image is loaded by an object reference or from a General field. Does not apply to images loaded by filename.
|
---|
ReportListener.SendGDIPlusImage Property [= iExpr] |
Return Value
Integer data type.
Note that the property is set to integer type, not logical, to allow for the possibility that a derived class might use other integer values to represent providing the image in other ways besides a graphics handle. For example, a derived class might recognize a value of 2 to indicate "load all file-based images from their original files, and copy them to a different location or different format."
The following lists the values for iExpr recognized by the baseclass ReportListener.
- 0 or any negative integer value
-
(0 is Default) The ReportListener baseclass does not provide a handle to GDI+ images to derived classes in the Render method.
- 1 and higher integer values
-
The ReportListener baseclass provides a handle to GDI+ images to derived classes in the Render method.
Remarks
Example
The following code fragment, showing three ReportListener methods, is similar to the internal methods of the XMLDisplayListener derived class. See ReportListener XML Display-Style Foundation Class for more information about this class and how it handles images.
In the BeforeReport event, the code in this example saves the current value of the SendGDIPlusImage. Then it checks to see if the report contains any General fields. If it finds any references to images in the layout information, it sets SendGDIPlusImage to 1 for the duration of the report.
| Copy Code |
---|
#DEFINE LISTENER_SEND_GDI_IMAGE_HANDLE 1
PROCEDURE BeforeReport()
THIS.oldSendGDIPlusImage = THIS.SendGDIPlusImage
IF (THIS.SendGDIPlusImage < LISTENER_SEND_GDI_IMAGE_HANDLE) ;
AND THIS.checkReportForGeneralFields()
THIS.SendGDIPlusImage = LISTENER_SEND_GDI_IMAGE_HANDLE
ENDIF
DODEFAULT()
ENDPROC
PROCEDURE checkReportForGeneralFields()
LOCAL liGeneralFields, llOpened
THIS.SetFRXDataSession()
IF USED("FRX")
* check,because
* the method might be called
* in the LoadReport() as well as BeforeReport()
SELECT FRX
ELSE
USE (THIS.CommandClauses.File) SHARED NOUPDATE ALIAS FRX IN 0
SELECT FRX
llOpened = .T.
ENDIF
COUNT FOR ObjType = FRX_OBJTYP_PICTURE AND ;
Offset = FRX_PICTURE_SOURCE_GENERAL TO ;
liGeneralFields
IF llOpened
USE IN FRX
ENDIF
THIS.SetCurrentDataSession()
RETURN ( liGeneralFields > 0 )
ENDPROC
PROCEDURE AfterReport()
DODEFAULT()
THIS.SendGDIPlusImage = THIS.oldSendGDIPlusImage
ENDPROC |
See Also