QGrid
![]() |
![]() ![]() |
QGObs_SetPicture(areaRef; tableNum; fieldNum; rectLeft; rectTop; rectRight; rectBottom; displayFormat):errorCode | |||
![]() |
areaRef | Longint | QGrid area reference |
![]() |
tableNum | Longint | Table number |
![]() |
fieldNum | Longint | Field number |
![]() |
rectLeft | Longint | Left coordinate |
![]() |
rectTop | Longint | Top coordinate |
![]() |
rectRight | Longint | Right coordinate |
![]() |
rectBottom | Longint | Bottom coordinate |
![]() |
displayFormat | Longint | Picture format number |
![]() |
error | Longint | Error result |
This QGrid v1.0 command is preserved in QGrid v1.1 for compatibility reasons.
It has been substituted by newer commands.
Sets up a picture object for area cells. Any previously defined picture object is deleted.
Parameter areaRef is the QGrid area reference. If areaRef is not a valid QGrid area reference, qg_paramErr error is returned.
Parameters tableNum and fieldNum specify the database field that will be the data source for the picture object. Passing a non-picture field will result in a qg_paramErr error.
Parameters rectLeft, rectTop, rectRight and rectBottom specify the picture box coordinates in the cell's coordinate system. Picture box coordinates can fall outside the cell bounds and even have negative values. In these cases only the visible part of the picture object's box is drawn on the cell. In case the values given do not specify a rectangle, error qg_InvalidRectErr is returned.
Long parameter displayFormat specifies the picture display format. QGrid defines the following constants for picture display formats:
qg_PictTruncCentered | 1 | Same as 4D's Truncated Centered (default) |
qg_PictScaledToFit | 2 | Same as 4D's Scaled To Fit |
qg_PictTruncNonCenter | 4 | Same as 4D's Truncated non Centered |
qg_PictScaledToFitProp | 5 | Same as 4D's Scaled to fit proportional |
qg_PictScaledToFitPropCenter | 6 | Same as 4D's Scaled to fit prop centered |
qg_PictXScaledToFitProp | 8 | Same as 4D's Scaled to fit proportional, but scales up as well |
qg_PictXScaledToFitPropCenter | 9 | Same as 4D's Scaled to fit prop centered, but scales up as well |
Example
` Set-up a picture object for area xGrid C_LONGINT($err;$tblNum;$fldNum;$left;$top;$right;$bottom;$format) $tblNum:=Table(->[Images]) $fldNum:=Field(->[Images]Picture) $left:=2 $top:=2 $right:=108 $bottom:=98 $format:=qg_PictXScaledToFitPropCenter $err:=QGObs_SetPicture (xGrid;$tblNum;$fldNum;$left;$top;$right;$bottom;$format) If ($err # qg_noErr) ` Handle the error End if |
Related commands
QG_SetCellPicture | Setup a picture object for the area cells |
QG_GetCellPicture | Return the current picture object |
QGObs_GetPicture | Return the current picture object (obsolete) |