473,385 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Graphics and Double Buffering

Hello,

I am using the Paint event to draw graphics, but I am getting annoying flickering. Is there anyway to perform double-buffering?

I have looked at creating a bitmap, but is limited in what I can do with it.

Any ideas?

Thanks
Simon Jefferies
si***@cooltoolsonline.co.uk

Nov 20 '05 #1
3 1184
Simon,
Include the following in your Form or Control's constructor.

' Stop the flicker
Me.SetStyle(ControlStyles.UserPaint, True)
Me.SetStyle(ControlStyles.DoubleBuffer, True)
Me.SetStyle(ControlStyles.AllPaintingInWmPaint, True)
Me.SetStyle(ControlStyles.ResizeRedraw, True)
Me.UpdateStyles()

This needs to be in the class you are painting ON, which can be different
then the object where the paint handler is. I normally handle the Paint
event in the same class that I am painting on.

Hope this helps
Jay

"Simon Jefferies" <si***@cooltoolsonline.co.uk> wrote in message
news:ON**************@TK2MSFTNGP11.phx.gbl...
Hello,

I am using the Paint event to draw graphics, but I am getting annoying
flickering. Is there anyway to perform double-buffering?

I have looked at creating a bitmap, but is limited in what I can do with it.

Any ideas?

Thanks
Simon Jefferies
si***@cooltoolsonline.co.uk
Nov 20 '05 #2
"Simon Jefferies" <si***@cooltoolsonline.co.uk> schrieb

I am using the Paint event to draw graphics, but I am getting
annoying flickering. Is there anyway to perform double-buffering?

I have looked at creating a bitmap, but is limited in what I can do
with it.

Any ideas?


Maybe somebody at
microsoft.public.dotnet.framework.drawing
can help you.

--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3
Thanks very much,

Works, just great!

Simon

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:Oc*************@tk2msftngp13.phx.gbl...
Simon,
Include the following in your Form or Control's constructor.

' Stop the flicker
Me.SetStyle(ControlStyles.UserPaint, True)
Me.SetStyle(ControlStyles.DoubleBuffer, True)
Me.SetStyle(ControlStyles.AllPaintingInWmPaint, True)
Me.SetStyle(ControlStyles.ResizeRedraw, True)
Me.UpdateStyles()

This needs to be in the class you are painting ON, which can be different
then the object where the paint handler is. I normally handle the Paint
event in the same class that I am painting on.

Hope this helps
Jay

"Simon Jefferies" <si***@cooltoolsonline.co.uk> wrote in message
news:ON**************@TK2MSFTNGP11.phx.gbl...
Hello,

I am using the Paint event to draw graphics, but I am getting annoying
flickering. Is there anyway to perform double-buffering?

I have looked at creating a bitmap, but is limited in what I can do with it.
Any ideas?

Thanks
Simon Jefferies
si***@cooltoolsonline.co.uk

Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Sanjay | last post by:
hi, We are currently porting our project from VB6 to VB .NET. Earlier we used to make scale transformations on objects like pictureBox , forms etc.Now Such transformations are made on the...
0
by: bullshark | last post by:
I have a C# application that manipulates images. The application provides the ability to pan around the images. Normally you can "grab" the image and move it around and it moves in real time with...
2
by: Jason | last post by:
I have created a 2d isometric game map using tiles and now I'm trying to move around my map..when i go near the edge of the map I want to redraw the map to show new parts of the map however the...
7
by: Peter Row | last post by:
Hi, I've started work on my own control some parts of which use standard controls, others I need to draw on my controls surface to get the display output I require, however.... I seem to be...
17
by: Galen Somerville | last post by:
The following code just shows a small portion of the overall Graphics on my Sweep form. I set the Panel to a medium Grey color so it stands out on a Windows Grey screen. The first thing that...
11
by: cty0000 | last post by:
I have some quiestion... I want to draw line,point,rectangles and etc... on the from So I code like this.. public update() { g = this.CreateGraphics(); g.FillRectangle(Brushes.White, x1,...
11
by: Peter Webb | last post by:
I previously asked about two problems I had with some graphics - the first was that when I drew animation to a picturebox it wouldn't display when the Form loaded. It was suggested to me by...
3
by: Alexander Vasilevsky | last post by:
What paint faster than Graphics.Draw? http://www.alvas.net - Audio tools for C# and VB.Net developers + Christmas discount
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.