473,503 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ReDrawing of Bitmap is not smooth :(

Friends,

The problem I am facing is that when my form resizes or is loaded
(invalidated), the background image of my form (which i have drawn
through GDI+ and also by putting a picture box on the form) is redrawn
several times which cause it to flicker a lot.
setstyles(controlstyles.doublebuffer, true ) didn't solved my problem.
I have 8 panels, 2 listviews and a few text boxes.

All panels are transparent so the portions of background image can be
shown.

Desperate need of assistance....
Thanks in advance...

Regards,

Apr 21 '06 #1
2 2426
Double-buffering the form will not double-buffer the child controls too.

You will be able to reduce the problem by not calling the default
OnPaintBackground because that surely paints everything battleship grey
before you get to paint your own background.

Transparent controls are notoriously troublesome because they rely on
forcing the parent window to repaint itself in their graphics surfaces.

Try not to use PictureBox if you can help it. I can't be double buffered.
You can derive from it or even create your own from scratch and enable it's
own buffering.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Khadim" <as***********@gmail.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
Friends,

The problem I am facing is that when my form resizes or is loaded
(invalidated), the background image of my form (which i have drawn
through GDI+ and also by putting a picture box on the form) is redrawn
several times which cause it to flicker a lot.
setstyles(controlstyles.doublebuffer, true ) didn't solved my problem.
I have 8 panels, 2 listviews and a few text boxes.

All panels are transparent so the portions of background image can be
shown.

Desperate need of assistance....
Thanks in advance...

Regards,

Apr 21 '06 #2
Bob,
thanks for ur reply....
Transparent controls are notoriously troublesome because they rely on
forcing the parent window to repaint itself in their graphics surfaces. Try not to use PictureBox if you can help it. I can't be double buffered.
You can derive from it or even create your own from scratch and enable it's
own buffering.


I have also tried OnPaintBackground, by overridding it with an empty
body. But having almost same filkering. Also I have written in my post
that besides picture box I used GDI+ to paint my image as background
but the problem remains same as u wrote that transparent controls force
parent window to repaint itself in their graphics sirface.

Should I assume that this behaviour can't be tackled?

Regards with thanks,

Apr 22 '06 #3

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

Similar topics

0
3417
by: Otie | last post by:
I have a circle that displays information in 1-degree increments - there are 90 such increments that comprise the circle. I need a pointer within the circle that rotates. The pointer must include...
2
1367
by: Hugh Janus | last post by:
Hi all, I am drawing some lines on a picturebox control. In the .Paint event of the picturebox I draw the lines of a graph. These lines are static and never move. Now, in the same Sub I am...
0
1155
by: Lars Netzel | last post by:
Hi I have the following code (never mind the actually logic in this, I know it sucks) which is very basic and a first try to create some kind of graph but I'm stuck on the quality it seems like...
4
1350
by: Lucas Napzchyr | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, im testing around a little with system.drawing. I setup a Form to paint on it. The problem: Paintig on a form or else is ok, but if my...
0
1000
by: klachemin | last post by:
I need to curve a bitmap a long a set of arbitrary line segments, tiling as necessary until the end of the curve. As a visual aid, imagine the points that make up a circle, and a tilable rope...
0
7083
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7278
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7456
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5011
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3166
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3153
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.