473,796 Members | 2,591 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1942
On Oct 1, 7:03*pm, JMe...@gmail.co m 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
3363
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). Reason for my question is that application has 5mb, while without graphics it has cca 400kb. Graphic files (bmps) take about 200kb (in program, they are repeated many times, ie almost all labels (around 200) have same background image)). Also,...
0
1401
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 so that it'll display very large strings with out comsuming so many resources. That is, as the size of the display string increases, the marquee uses additional CPU cycles. I've considered two possible solutions.
1
5333
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 left out of GDI+?. *** Sent via Developersdex http://www.developersdex.com ***
0
1013
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 (CreateGraphics, Nothing) If e.KeyCode = System.Windows.Forms.Keys.Left Then For XOffSet = 1 To 40 Step 1 ' Simulate scrolling. InvokePaint(Me, PaintEventArgument)
12
3604
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 utilities that allows you to view them with live rotation in a web browser. Also, it includes a introductory tutorial to POV-Ray.
2
4226
by: Overseer | last post by:
What is the best way to draw graphics like Task Manager's Performance Graphic??
2
2107
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 http://www.thescripts.com/forum/thread106125.html. The issue is the performance of this code. A simple program that fades two images at 1280x1024 takes ~100% CPU. This is of course an issue. I'm hoping to see if anyone has a suggestion on how to accomplish this in...
11
9312
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, y1, x2, y2); }
0
3038
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 doublebuffering turned on. I did learn tricks such as not invalidating everything, but just the control that is part of the form you are working on (i.e.,
0
9529
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10231
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10176
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10013
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7550
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5443
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5576
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4119
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2927
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.