Exemple #1
0
        public override void PaintBackground(Common.COMInterfaces.IVwGraphics vg, PaintTransform ptrans)
        {
            base.PaintBackground(vg, ptrans);             // might paint some pad or border around the block.
            Rectangle paintRect = ptrans.ToPaint(new Rectangle(Left + GapLeading(ptrans), Top + GapTop(ptrans),
                                                               ptrans.MpToPixelsX(MpWidth), ptrans.MpToPixelsY(MpHeight)));

            vg.BackColor = (int)ColorUtil.ConvertColorToBGR(BlockColor);
            vg.DrawRectangle(paintRect.Left, paintRect.Top, paintRect.Right, paintRect.Bottom);
        }
Exemple #2
0
        /// <summary>
        /// We paint images as "background" so that any adjacent text can overlap them slightly if necessary.
        /// </summary>
        public override void PaintBackground(Common.COMInterfaces.IVwGraphics vg, PaintTransform ptrans)
        {
            base.PaintBackground(vg, ptrans);             // might paint some pad or border around the block.
            Rect bounds = ptrans.ToPaint(new Rect(Left + GapLeading(ptrans), Top + GapTop(ptrans),
                                                  Right - GapTrailing(ptrans), Bottom - GapBottom(ptrans)));
            int hmHeight = Picture.Height;             // "HiMetric" height and width
            int hmWidth  = Picture.Width;

            vg.RenderPicture(Picture, bounds.left, bounds.top, bounds.right - bounds.left, bounds.bottom - bounds.top,
                             0, hmHeight, hmWidth, -hmHeight, ref bounds);
        }