LCDImageEx, LCDImageExR

Declaration

Delphi

function LCDImageExR(ImageKind, x, y: Word; Image: HBITMAP): Integer;
procedure LCDImageEx(ImageKind, x, y: Word; Image: HBITMAP); 

C/C++

SOPAD_API int SOPAD_LCDImageExR(int ImageKind, int x, int y, HBITMAP hImage);
SOPAD_API void SOPAD_LCDImageEx(int ImageKind, int x, int y, HBITMAP hImage);

ActiveX

HRESULT LCDImageExR([in] long ImageKind, [in] long x, [in] long y, [in] OLE_HANDLE Image, [out, retval] long* Result);
HRESULT LCDImageEx([in] long ImageKind, [in] long x, [in] long y, [in] OLE_HANDLE Image); 

Description

Function displays image on LCD or stores image for further processing.

The only difference between LCDImageEx and LCDImageExR is that LCDImageExR function returns value.

NOTE: This function only works with signature pads with colour display. For B/W Pads please see SetSignImage or SetSignImageEx 

Arguments

ImageKind

Type of image

ValueDescriptionReturn valueextentions
1Branding: after sign logo (+Pad V2 and similar)0


2View document on LCD

0: success
1: error
2: image too large 

  
and y is the position of image.
3View document on LCD, display sign buttonand y is the position of image.
4Store sign pageand y is the position of image.
5Clear sign page, store foreground image
6reserved for i don't know
7continuous scrolling mode

the parameters represents

x : ActualPageNumber

y : MaxTileNumber

8page requested

the parameter represents

x : actual page number, starting with 1 for the first page in PDF, requested by OnDeviceButton(Ex) with message type HID_CMD_BUTTON_JUMP_PAGE

y : page count  in PDF


and y

Position of image.

Image

Bitmap handle.

Return value

Return value depends on ImageKind, see above


Sample

C# - StandardSignMode
// Don't download BG image, don't do alpha-blending for ColourPad default SignMode       
const int DRIVER_OPTION1_DISABLE_CP_BACKGROUND_IMAGE = 0x00001000;
SigDev.SetDriverLong(0, SigDev.GetDriverLong(0) | DRIVER_OPTION1_DISABLE_CP_BACKGROUND_IMAGE);
                   
//  Read Size of Display
                     
int w = SigDev.GetDriverLong(20);
int h = SigDev.GetDriverLong(21);
                    
//  Create a image, of course you can also load an existing one
                     
Bitmap bmp = new Bitmap(w, h, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
Graphics gr = Graphics.FromImage(bmp);
                    
//  Add some text to the Image
gr.FillRectangle(new SolidBrush(Color.White), new Rectangle(0, 0, w, h));
gr.DrawString("Hello, World,", new Font("Arial", 16), Brushes.Black, new PointF(10, 10));
gr.DrawString("This is a Test", new Font("Arial", 16), Brushes.Black, new PointF(10, 50));
                    
//  Set as Default-SignMode Background Image
SigDev.LCDImageExR(5, 0, 0, (int)bmp.GetHbitmap());
			
// Start signing
Capturing = SigDev.startCapture("", true, true, true, true, ref padsetting);
C# - SignInDoc Mode
//  In case you want to Show Document Content as Background or you want to Change the hole Screen
                     
Bitmap bmp = new Bitmap(640, 470, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
                    
//  Set as SignInDoc Background
SigDev.LCDImageExR(4, 0, 0, (int)bmp.GetHbitmap());
//  Define a Signature Rectangle (for example with Size of 380x190 and place the signing area in the bottom center)
SigDev.CreateSignatureRectangle(130, 280, 380, 190, 0);
// Start signing
Capturing = SigDev.startCapture("", true, true, true, true, ref padsetting);
VB.net
        Private Const DRIVER_OPTION1_DISABLE_CP_BACKGROUND_IMAGE As Integer = &H1000  
 
  	'  Checking for Device Typ to use the correct way to load the Signing-Background on it
        Dim devicetyp As String = AxStepOverSignatureDevice1.GetDriverString(DRIVER_STRING_DEVICE_NAME)
 
        if devicetyp = "StepOver naturaSign Pad Colour" then        
            ' Pad Typ StepOver naturaSign Colour, only the SignInfo Area can be changed with API, 
            ' the Input area can be change with Imageloader
            ' load a image which will used as background
            Bitmap bmp = new Bitmap(@"TEST1.bmp");                
            Dim gr As Graphics = Graphics.FromImage(bmp)
            '  put some Text on the Image
            gr.DrawString("Hello, World,", new Font("Arial Bold", 32), Brushes.Green, new PointF(30, 40))
            gr.DrawString("This is a Test", new Font("Arial Bold", 32), Brushes.Green, new PointF(30, 140))
                
            ' Set Background Image
            AxStepOverSignatureDevice1.LCDImageExR(5, 0, 0, bmp.GetHbitmap())
        else if (devicetyp = "StepOver naturaSign Pad Comfort" or 
                 devicetyp = "StepOver naturaSign Pad Flawless") then
            ' Comfort and Flawless works simelar than the colourpad, only that the hole screen is 1 image
            ' Read Size of Display
            Dim w As Integer = AxStepOverSignatureDevice1.GetDriverLong(DRIVER_LCD_WIDTH)
            Dim h As Integer = AxStepOverSignatureDevice1.GetDriverLong(DRIVER_LCD_HEIGHT)
            ' Create a image, of course you can also load an existing one it must have the size of 480x272
            Bitmap bmp = new Bitmap(@"TEST2.bmp");  
            Dim gr As Graphics = Graphics.FromImage(bmp)
            ' Add some text to the Image
            gr.DrawString("Hello, World,", new Font("Arial", 16), Brushes.Green, new PointF(10, 60))
            gr.DrawString("This is a Test", new Font("Arial", 16), Brushes.Green, new PointF(10, 90))
            ' Set Background Image
            AxStepOverSignatureDevice1.LCDImageExR(5, 0, 0, bmp.GetHbitmap()) 
 
	Dim padsettings As String = ""
	Capturing = AxStepOverSignatureDevice1.startCapture("", True, True, True, True, padsetting)
C++
        //  Pad Typ StepOver naturaSign Colour, only the SignInfo Area can be changed with API, 
        //  the Input area can be change with Imageloader
		//  Comfort and Flawless works simelar than the colourpad, only that the hole screen is 1 image

    	// Don't download BG image, don't do alpha-blending for ColourPad default SignMode
		DRIVER_OPTION1                            = 0;
    	DRIVER_OPTION1_DISABLE_CP_BACKGROUND_IMAGE= $00001000;

    	SigDev.SetDriverLong(DRIVER_OPTION1, SigDev.GetDriverLong(DRIVER_OPTION1) or DRIVER_OPTION1_DISABLE_CP_BACKGROUND_IMAGE);
        //  load a image which will used as background
        // Bitmap bmp = new Bitmap(@"TEST1.bmp");
		HBITMAP hbitmap = ::LoadBitmap(hInstance,MAKEINTRESOURCE(IDB_COLOURPAD_DEFAULT_BG));

		BITMAP bm;
		GetObject( hbitmap, sizeof(BITMAP), &bm );
		long w = bm.bmWidth;
		long h = bm.bmHeight;

		//prepare the bitmap attributes
		BITMAPINFO bmInfo;
		memset(&bmInfo.bmiHeader,0,sizeof(BITMAPINFOHEADER));
		bmInfo.bmiHeader.biSize     = sizeof(BITMAPINFOHEADER);
		bmInfo.bmiHeader.biWidth    = w;
		bmInfo.bmiHeader.biHeight   = h;
		bmInfo.bmiHeader.biPlanes   = 1;
		bmInfo.bmiHeader.biBitCount = 24;

		//create a temporary dc in memory.
		HDC pDC   = ::GetDC(0);
		HDC TmpDC = CreateCompatibleDC(pDC);

		//create a new bitmap and select it in the memory dc
		BYTE *pbase;
		HBITMAP TmpBmp = CreateDIBSection(pDC,&bmInfo,DIB_RGB_COLORS,(void**)&pbase,0,0);
		HGDIOBJ TmpObj = SelectObject(TmpDC,TmpBmp);

		//draw the background
		HDC		dcBmp	= CreateCompatibleDC(TmpDC);
		HGDIOBJ TmpObj2 = SelectObject(dcBmp,hbitmap);
		
		BitBlt(TmpDC,0,0,w,h,dcBmp,0,0,SRCCOPY);

		//choose the font
		CFont    m_Font;
		LOGFONT *m_pLF;

		m_pLF = (LOGFONT*) calloc(1,sizeof(LOGFONT));
		wcsncpy_s(m_pLF->lfFaceName,32,_T("Arial Bold"),11);
		m_pLF->lfHeight = 32;
		m_pLF->lfWeight = 0;
		m_pLF->lfItalic = 0;
		m_pLF->lfUnderline = 0;
		HFONT hfont = CreateFontIndirect(m_pLF);
		HGDIOBJ pOldFont;

		if (hfont) 
			pOldFont = SelectObject(TmpDC,hfont);
		else 
			pOldFont = SelectObject(TmpDC,GetStockObject(DEFAULT_GUI_FONT));

		//draw the text 
		SetBkMode(TmpDC,TRANSPARENT); 
		SetTextColor(TmpDC,RGB(0,150,0));

		TextOut(TmpDC,30,40,_T("Hello, World,") ,13); 
		TextOut(TmpDC,30,140,_T("This is a Test"),14); 

		// cleanup 
		SelectObject(TmpDC,pOldFont);
		m_Font.DeleteObject();
		free(m_pLF);

		SelectObject(TmpDC,TmpObj2);
		DeleteDC(dcBmp);

		DeleteObject(hbitmap);
		hbitmap = TmpBmp;

        //  Set Background Image
        SigDev.LCDImageExR(5, 0, 0, (long) hbitmap);

		//final cleanup
		SelectObject(TmpDC,TmpObj);
		DeleteDC(TmpDC);

		DeleteObject(hbitmap);		
 
Delphi
//  Pad Typ StepOver naturaSign Colour, only the SignInfo Area can be changed with API,
//  the Input area can be change with Imageloader

//  Create a new Image

bmp              := TBitmap.Create;
bmp.LoadFromResourceName(HInstance, 'IDB_ColourPadDefaultBG');  		// load a Image with the correct size (use GetDriverLong with 20 and 21 to read the display size)

//  Add some text to the Image
bmp.Canvas.Brush.Style  := bsClear;
bmp.Canvas.Font.Name    := 'Arial';
bmp.Canvas.Font.Height  := 32;
bmp.Canvas.Font.Color   := clGreen;
bmp.Canvas.Font.Style   := [fsBold];

bmp.Canvas.TextOut(30,40, 'Hello World');
bmp.Canvas.TextOut(30,140,'This is a Test');
 
//  Don't download BG image, don't do alpha-blending for ColourPad default SignMode (for faster Transfer)
DRIVER_OPTION1_DISABLE_CP_BACKGROUND_IMAGE = $00001000;
StepOverSignatureDevice1.SetDriverLong(0, StepOverSignatureDevice1.GetDriverLong(0) or DRIVER_OPTION1_DISABLE_CP_BACKGROUND_IMAGE );
//  Set Background Image
SigDev.LCDImageExR(5, 0, 0, bmp.Handle);