public void DisplayError(string msg) { _bgLayer.reset(); _bgLayer.selectGrayPen(255); _bgLayer.drawBar(0, 0, _w, _h); _bgLayer.selectColorPen(0); _bgLayer.drawText(_w / 2, _h / 3, YDisplayLayer.ALIGN.CENTER, "ERROR !"); _bgLayer.drawText(_w / 2, _h * 2 / 3, YDisplayLayer.ALIGN.CENTER, msg); }
/** * <summary> * Selects the pen gray level for all subsequent drawing functions, * including text drawing. * <para> * The gray level is provided as a number between * 0 (black) and 255 (white, or whichever the lightest color is). * For monochrome displays (without gray levels), any value * lower than 128 is rendered as black, and any value equal * or above to 128 is non-black. * </para> * </summary> * <param name="graylevel"> * the desired gray level, from 0 to 255 * </param> * <returns> * <c>0</c> if the call succeeds. * </returns> * <para> * On failure, throws an exception or returns a negative error code. * </para> */ public virtual int selectGrayPen(int graylevel) { return(_objptr.selectGrayPen(graylevel)); }