System.Drawing.Graphics.Flush C# (CSharp) Method

Flush() public method

public Flush ( ) : void
return void
        public void Flush()
        {
            Flush (FlushIntention.Flush);
        }

Same methods

Graphics::Flush ( FlushIntention intention ) : void

Usage Example

Example #1
0
        void UpdateString()
        {
            if (!m_texture.Initialized)
            {
                return;
            }

            int width  = m_texture.Width;
            int height = m_texture.Height;

            Rectangle rect = new Rectangle(0, 0, width, height);

            Bitmap bitmap = new Bitmap(width, height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);

            System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(bitmap);
            graphics.TextRenderingHint = TextRenderingHint.AntiAlias;
            graphics.Clip = new Region(rect);

            graphics.DrawString(m_text, m_font, m_brush, 0.0f, 0.0f);
            graphics.Flush();

            BitmapData data = bitmap.LockBits(rect,
                                              ImageLockMode.ReadOnly,
                                              System.Drawing.Imaging.PixelFormat.Format32bppArgb);

            GraphicsCommand.UpdateTextureRGBA(m_texture, data.Scan0);

            bitmap.UnlockBits(data);

            m_updateString = false;

            bitmap.Dispose();
            graphics.Dispose();
        }
All Usage Examples Of System.Drawing.Graphics::Flush