The output of the following snippet is a line drawn in the canvas control, "CanvasDrawText() failed with code -14", then another line drawn in the canvas control. Why is CanvasDrawLine() failing?
char sMessage[200];
int iRet;
// Rect TextRect = { 1, 1, 40, 200 };
static char sFontName[] = { "NewFont" };
Point TextPoint = {0,0};
Point LinePoint = {0,50};
CanvasDrawLine( pGraphic->phPanel, pGraphic->iControlID,
TextPoint, LinePoint );
iRet = CanvasDrawText( pGraphic->phPanel, pGraphic->iControlID,
"Sample Text", VAL_APP_META_FONT, MakeRect( 20, 30, 150, 200 ),
VAL_CENTER_JUSTIFIED );
if ( iRet < 0 ) {
sprintf( sMessage, "CanvasDrawText() failed with code %i", iRet );
MessagePopup( "Message", sMessage );
} else MessagePopup( "Message", "CanvasDrawText() passed" );
CanvasDrawLine( pGraphic->phPanel, pGraphic->iControlID,
pAxis->Axis.Line.Start, pAxis->Axis.Line.End );