|
And your problem is?
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
OriginalGriff wrote: And your problem is?
My problem is; is it good to serialize or is there a better way. Is taking all the screenshots simultaneously good idea for the performance side? Is the way I am taking right?
|
|
|
|
|
teknolog123 wrote: is it good to serialize or is there a better way
Probably - it has the advantage of relative simplicity. However, you might find that either saving it to a database (which would depend on the databases you have available but they all support it), or to a file on the server is as simple (Image.Save(myPathName) is pretty simple...) I would probably go with the database option, but then I always have databases kicking about and the DB engine gets to handle the multi-user aspect of things - which it is pretty damn good at!
teknolog123 wrote: Is taking all the screenshots simultaneously good idea for the performance side
Why would that have any effect on performance? Each PC would have to take it's own screen shot, so there is no performance hit anywhere I can see.
teknolog123 wrote: Is the way I am taking right?
That depends on what you are trying to achieve!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
teknolog123 wrote: is it good to serialize or is there a better way.
To achieve what exactly? If you want this log on the server, then it might be best to just dump the screenshot on the client and to zip them and to pick these packages up at midnight.
Blasting each screenshot over the network as soon as it's taken would definitely add to the networkload. Depends on the quality and the size of your screenshot. Would you need to save it in full-color, or would a grayscaled image suffice?
teknolog123 wrote: Is taking all the screenshots simultaneously good idea for the performance side?
The overall performance on the client, the server, or the networkload? I'd suggest a round-robin, where the server 'requests' a screenshot from a client, then moves on to the next one. When done, rinse and repeat.
I are Troll
|
|
|
|
|
Taking a screenshot is a local matter, it is the client that does the work.
Sending the result to the server is also the client's job.
teknolog123 wrote: server shows them all on a form
You mean the server has a manned display? OK, no problem.
If the only purpose of the screenshots is to show them all at once at reduced resolution, then there is no need to transmit and/or store them at full size. If so, the client action should be:
- create a Bitmap containing the screen content
- create a new and smaller Bitmap from the earlier one
- send it to the server (using a shared folder, a database, whatever, on the server.
How often do you want this? is this a classroom supervisory system? taking movies of all client activity?
there may be capacity concerns, bandwidth concerns, privacy concerns.
|
|
|
|
|
Luc Pattyn wrote: How often do you want this? is this a classroom supervisory system? taking movies of all client activity?
This is for a classroom. The screenshot will only be taken by the admin not by specific intervals. It won't be saved to anyware, screen will be observed just for that moment.
|
|
|
|
|
I see no technical problems.
I recommend you let the clients take the first initiative, i.e. each client PC connects to the server and requests participation in the whole thing; that avoids you have to maintain a list of clients (beyond the class session), and gives you an opt-in situation, something most law systems cannot object to.
|
|
|
|
|
|
you're welcome.
|
|
|
|
|
I have a panel with transparent background, that I want to paint on multiple times. It paints alright the first time, but each time after that the drawing gets thicker. This problem is only with transparent backgrounds, drawing anything on it multiple times will make a drawing thicker on each painting event.
Any ideas how to overcome this problem?
modified on Sunday, September 12, 2010 8:10 AM
|
|
|
|
|
Just use the same panel and draw the content only on it.
Abhishek Sur
Don't forget to click "Good Answer" if you like this Solution. Visit My Website-->www.abhisheksur.com
|
|
|
|
|
The problem is that I have the panel inside a custom-made ScrollableControl. The program needs to draw some "drawing" on it as many times as user wants, each time a different drawing. As I've said the issue is only with transparent background and it seems it's a common problem. If you're just painting strings, then you can fix it by writing:
e.Graphics.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridFit;
But this makes the text look "ugly" and I also need to draw shapes. I fixed it for now by removing the panel from the scrollable-control, creating a new panel and adding it back to the control...
this.someControl.SuspendLayout();
this.someControl.Controls.Remove(this.someControl.aPanel);
this.someControl.aPanel = new Panel();
this.someControl.aPanel.BackColor = Color.Transparent;
this.someControl.aPanel.Paint += new
this.someControl.Controls.Add(this.someControl.aPanel);
this.someControl.ResumeLayout();
Of course I had to make the panel public.
|
|
|
|
|
Don't keep destroying and creating panels. That's expensive and inefficient. Try drawing to a Bitmap object (your offscreen buffer), then paint the panel with the bitmap image.
|
|
|
|
|
Doesn't work, same issue. Image (the drawings) get thicker on each painting event. So destroying and creating panels is only option that I know of that works.
|
|
|
|
|
I agree with Dave, purchasing a new panel (or anything else) inside the Paint handler is not a great idea and should be avoided.
I'm no expert on transparency graphics, and I am aware WinForms treats it in strange ways. My guess is selecting a transparent background color causes Windows not to erase the Control (i.e. not to repaint the background), so whatever gets painted never gets removed. What you could try is start your Paint handler with something based on Graphics.FillRectangle(Brushes.Transparent, Panel.Bounds) , mind you I haven't tested this.
|
|
|
|
|
Nope, still same problem. I don't see how this would work, because I think that anything you paint, it gets painted over the background and not the background itself (tried overriding OnPaintBackground, doesn't work either). It seems like it's an issue with clear-type, because I can notice red and green (or blue) outline around the drawn shapes getting thicker - same outline as if you'd take a screenshot and zoomed-in or use the magnifier tool on a clear-type text.
|
|
|
|
|
That is too bad. I'm afraid I can't help you any further. You'll need more Googling and some luck.
FWIW: the way I understand it, transparency is handled entirely different in WPF; I haven't tested it, and I was told the learning curve is rather steep...
|
|
|
|
|
Hi
I'm trying to work my way into the world of .NET programming so this question might be a no-brainer.
I'm trying to make a timer-control redrawing GDI graphics so that the GUI gets updated at regular time intervals.
The overrided OnPaint() is currently doing the drawing and it should be called from the timer_tick() method. Please take a look at the code below.
I looked for an onPaint() redraw/update method but couldn't find such one.
Can someone please give me a hint?
Thanks
Tom
public partial class Form1 : Form
{
Timer timer = new Timer();
Graphics g;
int x2 = 100;
int y2 = 100;
public Form1()
{
InitializeComponent();
timer.Tick += new EventHandler(timer_tick);
timer.Interval = 1000;
timer.Enabled = true;
timer.Start();
}
void timer_tick(object sender, EventArgs e)
{
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
}
protected override void OnPaint(PaintEventArgs pe)
{
g = pe.Graphics;
Pen pn = new Pen(Color.Black, 1);
Point pt1 = new Point(0, 0);
Point pt2 = new Point(x2, y2++);
g.DrawLine(pn, pt1, pt2);
if (y2 > 300)
y2 = 100;
}
|
|
|
|
|
Does this.Refresh(); help?
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
It sure does...
Thanks this is great
Tom
|
|
|
|
|
this.invalidate() works as well
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
Hi
Have anyone seen Photoshop CS5? I want to know how can I make a same titlebar with buttons and images?
|
|
|
|
|
I think this is not the place to ask about this question. Please put it in right section as there is nothing to deal with C# on this question.
Abhishek Sur
Don't forget to click "Good Answer" if you like this Solution. Visit My Website-->www.abhisheksur.com
|
|
|
|
|
Do the first 3 links in this[^] Google query help?
/ravi
|
|
|
|
|
Nope. Not a C# question.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|