SetSimpleDialogResourceText
Declaration
Delphi (DLL)
function SetSimpleDialogResourceText(ResourceText: PAnsiChar; XPos,YPos: Integer; Color,Background:Integer; WPARAM: integer ):integer;register;
C/C++ (DLL)
__stdcall int SOPAD_SetSimpleDialogResourceText(char *ResourceText, int XPos, int YPos, int Color, int Background, int WParam);
ActiveX
HRESULT _stdcall SetSimpleDialogResourceText([in] BSTR ResourceText, [in] long XPos, [in] long YPos, [in] long Color, [in] long Background, [in] long WParam, [out, retval] long* Result);
Description
draw an Text ( Max Length 53 characters ) at pixel position X,Y on the device.
Note: You have to activate a Font before you call this function.
Arguments
ResourceText: String;Â
e.g. "Hello World!"
XPos: integer
X Position of the left upper corner of the display position
YPos: integer
Y Position of the left upper corner of the display position
Color:Â integer
BGR value
Background: integer
BGR value
WParam:DWORD
not used yet
Note
The value for the Color is a 32 Bit integer in BGR Format (in Delphi TColor):
Bit 31-24 always 0
Bit 23-16 Blue Value 0 - 255
Bit 15-08 Green Value 0 - 255
Bit 07-00 Red Value 0 - 255
If you want a transparent font background colour, you need to set for the font colour and the font backcolour the same value.
Return value
SetSimpleDialogResourceText returns (SOPAD_ERROR_SUCCESS = 0) if it was possible to cache the settings.
Otherwise the function returns the appropriate error code. You can get extended error code with the help of GetSOPadError call.
Possible error codes are listed below: Driver error codes
Samples
// Upload Images to the Device (to shadow framebuffer, which means they not dirctly visible) SigDev.SetSimpleDialogResourceImage("", RessourcePath + "background.png", 0, 0, 0); // Select a font resource int fontStatus = SigDev.SetSimpleDialogResourceFont("arial14.sof", "", 0); // Set Text, Placement and Colour (Sample: Red=0x000000FF, Blue=0x00FF0000, Green=0x0000FF00, Yellow=0x0000FFFF) SigDev.SetSimpleDialogResourceText("This is a Test", 100, 300, 0x000000FF, 0x00FF0000, 0); // Red Text on Blue Background SigDev.SetSimpleDialogResourceText("Another Text", 100, 330, 0x000000FF, 0x000000FF, 0); // Red Text on Transparent Background // Update Screen (with all images which are loaded to shadow framebuffer) int displayOptionStatus = SigDev.SetSimpleDialogDisplayOption(1, 0);
// Upload Images to the Device (to shadow framebuffer, which means they not dirctly visible) SigDev.SetSimpleDialogResourceImage('', RessourcePath + 'background.png', 0, 0, 0); // Select a font resource SigDev.SetSimpleDialogResourceFont('arial14.sof', '', 0); // Set Text, Placement and black Text Colour and transparent Background color SigDev.SetSimpleDialogResourceText('This is a Test', 100, 300, clRed , clBlue, 0); // Red Text on Blue Background SigDev.SetSimpleDialogResourceText('Another Text', 100, 330, clRed , clRed, 0); // Red Text on Transparent Background // Update Screen (with all images/texts which are loaded to shadow framebuffer) SigDev.SetSimpleDialogDisplayOption(1, 0);