473,320 Members | 1,988 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,320 software developers and data experts.

Graphics Performance Issue

I am drawing simple graphics on a custom control which has a static
background image. When I try to rapidly (maybe 50 times per second)
redraw the graphics the computer can't keep up. There is no issue
when I just draw graphics on a control with a plain color as the
background but with an image set as the background it seems the
control redraws the background each time I refresh which makes its
performance poor. Is there a way to improve this situation?

Thanks,
Jo
Oct 1 '08 #1
2 1922
On Oct 1, 7:03*pm, JMe...@gmail.com wrote:
I am drawing simple graphics on a custom control which has a static
background image. *When I try to rapidly (maybe 50 times per second)
redraw the graphics the computer can't keep up. *There is no issue
when I just draw graphics on a control with a plain color as the
background but with an image set as the background it seems the
control redraws the background each time I refresh which makes its
performance poor. *Is there a way to improve this situation?

Thanks,
Jo
I'm not sure what all you're drawing, but I believe you can just set
the invalidation region on the control to only invalidate where you
are drawing. This would be helpful if you are only using one small
area of the control, but wouldn't do much if you were drawing over the
entire control.

One other thing that may or may not help (I'm a web developer so I've
been away from GDI+ for a while) is to use the graphics object to draw
the background as well. It could be that if it's all being done in one
place, you might have less parts spawning a redraw.

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
Oct 2 '08 #2
Thanks Seth.

I tried redrawing with the graphics object rather than the built-in
BackgroundImage property but that doesn't seem to really help. The
invalidate strategy might - I'm trying to figure out how to properly
use this. I'm making a dial gauge control, such that the measured
values show up as a needle moving around like in a physical pressure
gauge. The redraw is fine when I use the graphics object to draw the
gauge & needle but I figured it would be nice to have a static
background photoshopped version of a gauge with a needle that is
continually redrawn in front of it as new values come in. To do the
invalidation, would I just keep a minimum bounding rectangle around my
needle and invalidate that region only and then redraw the needle
somewhere else on the gauge area?

Thanks,
Jo
Oct 10 '08 #3

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

Similar topics

4
by: Martin | last post by:
I am using graphics as backgrounds for forms,buttons,labels etc. The question is: is it faster to load all graphics from files on app start or to use it embeded (places in editor during design)....
0
by: twostepted | last post by:
Hello, This is a bit of a long post (sorry) but here is the jist of it: I've developed a Windows forms User Control marquee (auto-scrolling text like a readerboard). I'm trying to optimize it...
1
by: James dean | last post by:
Could someone explain how this works. I think the graphics card is used to do blitting and drawing shapes like rectangles. How does it draw using the Graphics card on the PC and why is this feature...
0
by: The Confessor | last post by:
I've narrowed down my problem, but I've yet to find a solution, so here goes again: Private Sub Form_Main_KeyDown() Handles MyBase.KeyDown Dim PaintEventArgument As New PaintEventArgs...
12
by: Xah Lee | last post by:
Of Interest: Introduction to 3D Graphics Programing http://xahlee.org/3d/index.html Currently, this introduction introduces you to the graphics format of Mathematica, and two Java Applet...
2
by: Overseer | last post by:
What is the best way to draw graphics like Task Manager's Performance Graphic??
2
by: kirkage | last post by:
I am attempting to create a program in C# which part of it consists of one image fading to another. The best way I found this to work is from an example by Bob Powell on the thread...
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,...
0
by: raylopez99 | last post by:
Hi, I'm getting into GDI+ Forms 2.0 graphics for C#3 using Visual Studio 2008. One thing I notice: the graphics are really slow and flicker on a Pentium IV, with 2 GB RAM, even with...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.