48
API Reference
124
hContents: Handle to an object of type HMETAFILE, HENHMETAFILE, HICON
or HBITMAP
lPara: LL_DRAWING_HMETA, LL_DRAWING_HEMETA, LL_DRAWING_HICON
or LL_DRAWING_HBITMAP
lpPara: For further extensions, must be NULL.
Return Value:
Error code
Hints:
Please note the general hints in the section "1.3.3. Variables and Fields".
This function defines a text field and can be mixed with the other
LlDefineField...() functions.
List & Label predefines the fields listed in LlDefineField().
The metafile handle must be valid as long as it is needed, that is during the
entire layout definition or until after LlPrintFields() or LlPrint() has finished.
After use the handle can or should be deleted with the normal API function.
Example:
hJob hJob;
HMETAFILE hMeta;
HDC
hMetaDC;
INT
i;
hMetaDC = CreateMetaFile(NULL); // Fieberkurve
selectObject(hMetaDC,GetStockObject(NULL_PEN));
Rectangle(hMetaDC, 0, 0, LL_META_MAXX, LL_METY_MAXY);
for (i = 0; i < 10; ++i)
{
MoveTo(hMetaDC,0,MulDiv(i, LL_META_MAXY, 10));
LineTo(hMetaDC,MulDiv(i, LL_META_MAXX, 100),
MulDiv(i, LL_META_MAXY, 10);
}
MoveTo(hMetaDC, 0, MulDiv(((100*i) & 251) % 100, LL_META_MAXY,100));
for (i = 0; i < 10; ++i)
LineTo(hMetaDC,MulDiv(i, LL_META_MAXX, 10),
MulDiv(((100*i) & 251) % 100, LL_META_MAXY, 100));
hMeta = CloseMetaFile(hMetaDC);
hJob = LlJobOpen(0);
LlDefineFieldStart(hJob);
LlDefineField(hJob, "Name", "Normalverbraucher");
LlDefineField(hJob, "Vorname", "Otto");
LlDefineFieldExt(hJob, "Ort", "Konstanz", LL_TEXT, NULL);
LlDefineFieldExtHandle(hJob, "Erfolgs-Chart", hMeta,
LL_DRAWING_HMETA, NULL);
<... etc ...>
LlJobClose(hJob);
DeleteObject(hMeta);