protected override void DoPaint(HCStyle aStyle, RECT aDrawRect, int aDataDrawTop, int aDataDrawBottom, int aDataScreenTop, int aDataScreenBottom, HCCanvas aCanvas, PaintInfo aPaintInfo) { using (Image vBitmap = SharpZXingBarCode.Create(FText, 3, Width, Height)) { if (vBitmap != null) { if (aPaintInfo.Print) { aCanvas.StretchPrintDrawImage(aDrawRect, vBitmap); } else { aCanvas.StretchDraw(aDrawRect, vBitmap); } } } // 绘制一维码 base.DoPaint(aStyle, aDrawRect, aDataDrawTop, aDataDrawBottom, aDataScreenTop, aDataScreenBottom, aCanvas, aPaintInfo); }