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

Some drawing problems...

Hi,

I'm writing an app that will show a scrolling transparent graph and I'm
ancountering some problems, explained in the following code:
(a VS project explaining the problem(s) can be downloaded at
http://www.icat.be/problems.zip )

The code is executed on a timer.tick event:

// Draw Using Double Buffering, this works perfectly if the monitor
// is set to 16-bit Color mode, if it is set to 32-bit color mode
// the background of the graph will be blue, I know this is a known bug
// bug ID KB820640, will Microsoft resolve this ????
BackgroundBmp.MakeTransparent(Color.Red);

this.OffScreenBmp = new Bitmap(BackgroundBmp);

this.OffScreenDC = Graphics.FromImage(this.OffScreenBmp);

Graphics ClientDC = this.CreateGraphics();

BackGroundBrush = new SolidBrush(Color.Blue); //Blue is the tranparencykey
of the form

this.OffScreenDC.FillRectangle(BackGroundBrush,0,0 ,this.NumberOfLines,MaxVal
);
for(int i=0;i<CounterArray.Count;i++)

{

Pen myPen = new Pen(Color.Red,1);

//Draw all the vertical Lines

this.OffScreenDC.DrawLine(myPen,i,MaxVal,i,MaxVal - (int)CounterArray[i]);

}
//Put it on the screen

ClientDC.DrawImage(this.OffScreenBmp,0,0);

// Draw using the Region property of Panel1, works perfectly on first sighth

// but when you place this app behind another window, and bring it back to
the

// front, the graph looks kinda "garbled", I don't know why, can someone
explain this?

// Is this a bug ???
myPath = new GraphicsPath();
//Add all the vertical lines to the path

for(int i=0;i<CounterArray.Count;i++)

{

myPath.AddLine(i,this.panel1.Height,i,this.panel1. Height -
(int)CounterArray[i]);

}

// Close the Path

myPath.AddLine(CounterArray.Count,this.panel1.Heig ht -
(int)CounterArray[CounterArray.Count -1],CounterArray.Count,this.panel1.Heig
ht);
this.panel1.Region=new Region(myPath);

Nov 15 '05 #1
2 1347
Sorry, wrong link in previous post, the VS Project explaining the problem
can be downloaded at http://www.icat.be/problem.zip

Regards,

Senne
Nov 15 '05 #2
Nobody found a solution for this yet ??

Regards,

Senne

"Senne Vaeyens" <do********@mail.com> wrote in message
news:40**********************@news.skynet.be...
Sorry, wrong link in previous post, the VS Project explaining the problem
can be downloaded at http://www.icat.be/problem.zip

Regards,

Senne

Nov 15 '05 #3

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

Similar topics

1
by: Norman Fritag | last post by:
Hi there I have avoided to use active x controls because I thought they are causing more problems then they are doing any good. I a new application I would want to use the tree and list view...
9
by: Steve Long | last post by:
Hello, (total GDI newbie) I'm having trouble drawing just a simple line to display in a picturebox. I just want a straight, dotdash line. I have two methods, one works and one doesn't (it cause...
6
by: James dean | last post by:
I have heard that the video drivers in GDI+ are a big performance issue. But is this only an issue with something like Games Programming i think...is this wrong?. What about a drawing application...
3
by: anastasia | last post by:
I get an out of memory exception when attempting to excecute the following code: original = System.Drawing.Image.FromFile(file.FileName,true); I ONLY get this exception when the file is in the...
8
by: Benoit Martin | last post by:
I had to draw my own control because I couldn't find any control doing what I wanted it to do. This control has a grid that I need to have control over. To do that, I draw each line of the grid...
2
by: Martin Horn | last post by:
Hi all, I'm adding basic drawing capability to an application that I am writing, and I have been having problems with making the graphics output persist when the application is re-sized,covered...
3
by: kamleshgk | last post by:
Hi, I have a requirement to draw a rectangle and a line on a the container control and sometimes as i move the mouse the drawing must occur on top of user controls and other controls, which are...
1
by: Andrew | last post by:
Hello Everyone I am receiving an error in an application I am working on. The application when its done will be a Dungeons and Dragons Network game. I am having problems with the Networked...
1
by: YouPoP | last post by:
I am doing an app (C# 2.0) where you can draw in a panel with your mouse in "real time". I actually have 2 problems; 1- it does not really is "real time", if your mouse move fast or very fast the...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
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
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
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.