예제 #1
0
        public void Dispose()
        {
            if (m_bmp != null)
            {
                m_bmp.Dispose();
                m_bmp = null;
            }

            if (m_style != null)
            {
                m_style.Dispose();
                m_style = null;
            }

            if (m_frames != null)
            {
                m_frames.Dispose();
                m_frames = null;
            }

            if (m_graphics != null)
            {
                m_graphics.Dispose();
                m_graphics = null;
            }
        }
예제 #2
0
        public Image Render()
        {
            m_style = createStyle(m_config);

            Bitmap bmp = m_bmp;

            if (bmp == null || (m_rcBounds.Height > 0 && bmp.Height != m_rcBounds.Height) || (m_rcBounds.Width > 0 && bmp.Width != m_rcBounds.Width))
            {
                bmp = new Bitmap(m_rcBounds.Width, m_rcBounds.Height);
            }

            Graphics g = m_graphics.Get(bmp);

            if (m_config.EnableSmoothing)
            {
                g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
            }
            else
            {
                g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None;
            }

            g.FillRectangle(m_style.BackBrush, m_rcBounds);

            foreach (GraphFrame frame in m_frames)
            {
                frame.Render(g);
            }

            m_graphics.Release(g);
            m_bmp = bmp;

            return(m_bmp);
        }