I currently developing an application (in C#) where I have to be able to
highlight different regions on the screen, by drawing a half-transparent
ellipse over it. Right now, the code I'm using is this:
// Get the Graphics object of the entire screen.
IntPtr dc1 = Utils.CreateDC("DISPLAY", null, null, (IntPtr)null);
Graphics g1 = Graphics.FromHdc(dc1);
// Draw filled ellipse
SolidBrush brush = new SolidBrush(Color.FromArgb(128, 0, 255, 0));
g1.FillEllipse(brush, x, y, w, h);
g1.Flush();
The problem with this is that I have no means of erasing what I have drawn.
Is there any way to draw on another "layer", so that the different windows I
draw on don't get draw on? 1 7168
As usual, a few minutes after posting a help-me thread, I find exactly what
I was looking for, despite hours of looking before posting :) This describes
exactly what I was after: http://www.codeproject.com/csharp/OSDwindow.asp
If anyone has another suggestion, I'm all ears.
/Bartek
"Bartek Tatkowski" <ba**************@nospam.com> skrev i meddelandet
news:OV**************@TK2MSFTNGP10.phx.gbl... I currently developing an application (in C#) where I have to be able to highlight different regions on the screen, by drawing a half-transparent ellipse over it. Right now, the code I'm using is this:
// Get the Graphics object of the entire screen. IntPtr dc1 = Utils.CreateDC("DISPLAY", null, null, (IntPtr)null); Graphics g1 = Graphics.FromHdc(dc1); // Draw filled ellipse SolidBrush brush = new SolidBrush(Color.FromArgb(128, 0, 255, 0)); g1.FillEllipse(brush, x, y, w, h); g1.Flush();
The problem with this is that I have no means of erasing what I have drawn. Is there any way to draw on another "layer", so that the different windows I draw on don't get draw on?
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Remon Huijts |
last post by:
Hi there,
For a very specific service, I have created a PHP script that uses the GD
library functions to create a PNG image from a few lines of XML data
describing a simple diagram/drawing. It's...
|
by: Leif K-Brooks |
last post by:
I'm considering writing a fairly basic vector drawing program using
PyGTK. What's the best way to render it? What I'm thinking of is having
everything render on a PIL image, then display that in...
|
by: WALDO |
last post by:
I have an interesting quandary.
I have developed a program in VB.Net to extract an icon resource from an
exe/dll or from an ico file and enumerate its formats (16x16,256
color;32x32,true...
|
by: Tomi Holger Engdahl |
last post by:
I am looking for a solution to add on-line drawing tool
to a phpBB discussion board.
The idea would be that the users can draw their own
simple drawings with the tool and attach them easily
as...
|
by: Metallicraft |
last post by:
I have a vb6 application. On the main form is a picture
box with one or two images and several pieces of text
displayed in it. These are created on the fly using gdi32
routines that are all in a...
|
by: Sam |
last post by:
Hi guys
I'm writing a small drawing program which has "snap to grid" mode and I
want to display something (some kind of shapes for example a small square or
circle which indicate the current...
|
by: benoit |
last post by:
Hi,
I have this question.
When I use the FileUpload WebControl to post an Image (= SourceFile) that I
want to resize and write to the server, I keep getting this situation.
If that SourceFile...
|
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...
|
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,...
|
by: =?Utf-8?B?R2lkaQ==?= |
last post by:
Hi,
I've windows form, in this form i've a panel.
I want to draw lines inside the panel using the panel coordinates( meaing
that the left upper corner of the panel is 0,0), how can i do it?
...
|
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...
|
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: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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
|
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...
|
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...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |