예제 #1
0
        public override bool Render(ProjectLayoutElement zElement, Graphics zGraphics)
        {
            if (zElement.height < (TargetRect.Y + TargetRect.Height))
            {
                // too tall, completely end the draw
                return(false);
            }

            // draw border (debugging)
            if (CardMakerInstance.DrawFormattedTextBorder)
            {
                zGraphics.DrawRectangle(Pens.Green, TargetRect.X + m_fXOffset, TargetRect.Y + m_fYOffset, TargetRect.Width, TargetRect.Height);
            }

            // already null checked in the ProcessMarkup
            var zBmp = 255 != zElement.opacity
                ? DrawItem.LoadOpacityImageFromCache(m_sImageFile, zElement)
                : DrawItem.LoadImageFromCache(m_sImageFile);

            zGraphics.DrawImage(zBmp, TargetRect.X + m_fXOffset, TargetRect.Y + m_fYOffset, TargetRect.Width, TargetRect.Height);

            if (CardMakerInstance.DrawFormattedTextBorder)
            {
                zGraphics.FillRectangle(new SolidBrush(Color.FromArgb(32, 255, 0, 0)), TargetRect.X, TargetRect.Y, TargetRect.Width, TargetRect.Height);
            }

            return(true);
        }
예제 #2
0
        public override bool Render(ProjectLayoutElement zElement, Graphics zGraphics)
        {
            // already null checked in the ProcessMarkup
            var zBmp = 255 != zElement.opacity
                ? DrawItem.LoadOpacityImageFromCache(m_sImageFile, zElement)
                : DrawItem.LoadImageFromCache(m_sImageFile);

            zGraphics.DrawImage(zBmp, TargetRect.X + m_fXOffset, TargetRect.Y + m_fYOffset, m_nWidth, m_nHeight);

            if (CardMakerInstance.DrawFormattedTextBorder)
            {
                zGraphics.FillRectangle(new SolidBrush(Color.FromArgb(32, 0, 255, 0)), TargetRect.X, TargetRect.Y, m_nWidth, m_nHeight);
            }
            return(true);
        }