473,765 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.M akeTransparent( Color.Red);

this.OffScreenB mp = new Bitmap(Backgrou ndBmp);

this.OffScreenD C = Graphics.FromIm age(this.OffScr eenBmp);

Graphics ClientDC = this.CreateGrap hics();

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

this.OffScreenD C.FillRectangle (BackGroundBrus h,0,0,this.Numb erOfLines,MaxVa l
);
for(int i=0;i<CounterAr ray.Count;i++)

{

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

//Draw all the vertical Lines

this.OffScreenD C.DrawLine(myPe n,i,MaxVal,i,Ma xVal - (int)CounterArr ay[i]);

}
//Put it on the screen

ClientDC.DrawIm age(this.OffScr eenBmp,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<CounterAr ray.Count;i++)

{

myPath.AddLine( i,this.panel1.H eight,i,this.pa nel1.Height -
(int)CounterArr ay[i]);

}

// Close the Path

myPath.AddLine( CounterArray.Co unt,this.panel1 .Height -
(int)CounterArr ay[CounterArray.Co unt -1],CounterArray.C ount,this.panel 1.Heig
ht);
this.panel1.Reg ion=new Region(myPath);

Nov 15 '05 #1
2 1367
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********@mai l.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
4174
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 control in access 2002. Prior to that I like to fine some information or here some feed back from developers who have use active x controls success fully in there application, what their experience was.
9
2411
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 an exception to be thrown): This one works but it's not the results I want. private void CreateImage1() {
6
4057
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 just drawing simple one dimensional shapes(Polygons,beziers,polylines etc...) are these video drivers still useful for this?. If the video drivers are not a problem then is there any other performance problems that would be disastrous for a...
3
20109
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 "My Documents" folder or subfolders. If the file lives anywhere else on the hard drive, I have no problems. What could be going on here?
8
5651
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 using a 1pixel pictureBox. I also need "boxes" to be placed within that grid depending on data pulled from my dataset. I also used pictureBox controls for that. All those components that I use to draw my control are added to the controls collection...
2
1434
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 etc. This is the solution I have come up with, but it seems a bit convoluted. Before I get too far into the development of the program, could someone cast an eye over my code and tell me if I have approached it in the correct way, or suggest a...
3
8454
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 placed in the container control... I'm using System.Drawing namespace (C#) to perform the drawing. But as i move the mouse and draw the rectangles, the drawing takes place behind the user controls....I have a requirement to
1
1790
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 Canvas basically for drawing the dungeon maps If I initialize two of the Tkinter Canvas widgets with in the same window I can draw across the network, however if I open a second instance of the Application and initialize the canvas, on windows I recv
1
3986
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 line is added after a very small delay. 2-Because I use AddLine(), it adds very short lines from one point to another and it does not give a very good result. Also because of this and my "not real time" problem, when the mouse moves fast it adds...
0
9404
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
10007
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
9959
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
9835
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
7379
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
6649
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5277
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...
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
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.