beautypg.com

Example of styled osd usage – Sensoray 2253 Windows User Manual

Page 59

background image

Example of Styled OSD usage

(adapted from OsdExtended.cpp in demo program)

MID2253_OSD_STYLEDTEXT osd;
MID2253_OSD_DATA osddata;
TCHAR text[160];
char font[260];
char windir[260];
LPTSTR sOsd;
unsigned char osd_line[160];
GetWindowsDirectoryA(windir, 260);
memset(&osd, 0, sizeof(osd));
osd.osdOn = 1;
osd.osdChan = 0; // Stream A
osd.id = 0; // First OSD Window
osd.xoffset = 50;
osd.yoffset = 50;
_snprintf(font, 260, “%s\\fonts\\arial.ttf”, windir);
osd.font = (LPSTR) font;
osd.size = 30; // 30 point font // point size of text
osd.style = 0;
osd.outline = 0;

// outline style: 0=transparent

osd.background = 0; // background style: 0=transparent
osd.color = 0; // not applicable for Stream A
wsprintf(text, L”2253 Caption Test”);
sOsd =text;
WideCharToMultiByte(CP_UTF8, 0, sOsd, -1, (LPSTR) osd_line, sizeof(osd_line),
NULL, NULL);
osd.line = (LPSTR) osd_line;
osddata.osdstyledtext = osd;
S2253_SetOsd(MID2253_OSDTYPE_STYLEDTEXT, &osddata, 0, 0);

59

This manual is related to the following products: