Appendix c - fast graphic overlays, Support, Screen_size – Sensoray 2224 Windows User Manual
Page 85: Gtest

Appendix C - Fast graphic overlays
The new fast graphics Overlay API consists of a single function:
SN_CopyBmpToOverlayZero(...)
This function can be hard to use, but is made much easier with the supporting TCL gxxx routines.
(gopen, gclose, gwrite, gpen, gbrush, gsetrop2, gbkmode, gsetbkcolor, gtextcolor, gfont, gtext, grect,
grrect, gellipse, gmoveto, glineto, gloadimage, gbitblit, gstretchblt, gfixblack, gtest)
The heart of the new framework is the gwrite command which calls tcl_gwrite() in jim_TclShell.cpp
In this procedure, a Windows GDI bitmap and device context pair is converted to a flat RGB bitmap that
is then sent to the 2226 hardware via the SN_CopyBmpToOverlayZero() API routine. The advantage of
this API routine over the other 2226 API overlay routines is that it only downloads the pixels in the
memory structure passed to it. The other API routines must merge all eight window-index regions and
download the combined count of pixels.
In addition to this fast update rate, this routine is more flexible in that the source of the overlay to be
downloaded is a Windows bitmap and all the Windows GDI tools can be used to create it's contents on
the fly.
The fast graphics tools are divided in to Support, Graphics, Text, and Bitmap routines.
Support
screen_size
This routine is a TCL procedure that other TCL routines can use to determine the Width and Height of
the Video input. It returns the input video Width and Height in a list.
cls
This routine is a TCL procedure that is used to generate and download a full-screen transparent overlay
to Overlay-Index 0.
Calling this function prior to using the gxxx routines satisfies CopyBmpToOverlayZero()'s Width and
Height restrictions.
This could also be done by using ovlimagei to load a full screen image to Index-0 (i.e. ovlimagei [fname
$imagpath HD_Halo_with_hole.bmp] 0 0 0) Where the file HD_Halo_with_hole.bmp is the same size as
the selected input resolution.
gtest
This routine is a self-contained example of how to use the Windows GDI graphics routines with the fast
CopyBmpToOverlayZero() API routine. It creates a Device Context and Selected Bitmap for creating
graphics. Draws some graphics onto this Bitmap. Converts this Bitmap to a flat RGB bitmap that can be
downloaded. Downloads the bitmap via CopyBmpToOverlayZero() and then cleans up/frees the drawing
resources that were used.
The rest of the gxxx routines, follow the same sequence as define in this routine, but break it up into
modular pieces that can be used to build dynamic overlays.
85