|
|
Brian Delahunty wrote:
I'm embedding plink.exe
I have putty installed on my computer now, I love that little app, so many things that you simply can't do with MS Telnet.
-Nick Parker
|
|
|
|
|
Hi!
I write a simple image processing tookit in c#. I face a trouble that c# seems didn't release the garbage. because my image is fairly large (around 6000*6000), it is very apparent. After several operations, physical used up, the pc works very slowly.
Give a simple example. There is a picturebox in the form, in form_load, load a 6000*6000 gray image into picturebox.
Then
private void button1_Click(object sender, System.EventArgs e)
{
Bitmap dst;
bool ret = Form1.Dup(this.pictureBox1.Image as Bitmap, out dst);
if (ret)
{
this.pictureBox1.Image = dst;
}
}
//get a new image from the original one
public static bool Dup(Bitmap src, out Bitmap dst)
{
dst = new Bitmap(src.Width, src.Height, src.PixelFormat);
dst.Palette = src.Palette; //it will be black, but never mind, just take the space
return true;
}
After press the button several time, i can see a lot of memory is taken by this process. and it seems not to release it at all. But in my code, only one copy is reference by pictureBox1.Image.
anybody know how to solve it?
Thanks!!
|
|
|
|
|
|
I have two sets: A{1,2,3,4,5} and B{1,3,5}
I need to create set C{2,4}.
Is there an optimal algorithm designed for this task?
Right now I’m simply going to stick A into an array and sort it.
Then I’ll iterate through each element in B and do a binary search for it in A. If not found then put it into C.
Is there a better way?
|
|
|
|
|
Try the following site
http://home.att.net/~srschmitt/Sets_class.html
|
|
|
|
|
Try this[^].
α.γεεκ Fortune passes everywhere. Duke Leto Atreides
|
|
|
|
|
CP rules! Thanks guys. Your suggestions were great . . . and that set article is terrific!
|
|
|
|
|
I’m not familiar with the Modified property but the locked property, from what I understand, is only used by the designer. I find that it comes in handy when you don’t what a control to get moved by mistake.
Did you write the designer in C#? I’m not trying to be cute, but perhaps you should make this “bug” a “feature”.
|
|
|
|
|
Hey Zero,
Sorry to get off topic but I tried to create a designer in C# about a year ago and gave up. The problem that I ran into was:
1)Place a control onto the workspace.
2)Place a second larger control that completely covers the first control.
3)Click and do a rubber band select of the second control (the rubber band rect completely surrounds both controls.)
4)Release the mouse.
Now both controls should be "highlighted" to show that they are selected. You should see the highlight of the fist control appear on top of the second control - even though it is totally "under" the second control and not visible. (That's how it works in visual studio.)
I overrode every thing I could think of and even tried doing things in the WndProc to get the first control’s "highlight" rect to appear on top of the second control but nothing I did would make it appear because the second control was always drawn over the first’s highlight rec.
How did you accomplish it?
|
|
|
|
|
The Visual Studio IDE is used by Developers. These kinds of people dislike being restricted.
|
|
|
|
|
My web service methods return some non-string value(for example DateTime) , I want when some error(Exception) happend in my method I retuurn that error to the client. How can I report it to the client,for example send a string messsage error?
Mazy
No sig. available now.
|
|
|
|
|
One way could be to always return an XML string that could contain one of the following elements:
<ERRORS>
or
<RETURNVALUE>
Cheers,
Simon
"Don't try to be like Jackie. There is only one Jackie.... Study computers instead.", Jackie Chan on career choices.
animation mechanics in SVG (my first abstract photo)
|
|
|
|
|
Thanks Simon.
How can I do this in my web service code?
Mazy
No sig. available now.
|
|
|
|
|
You'd need to wrap the error/return value into a string manually.
Not sure how you could automate that. Maybe using an HTTPHandler?
Cheers,
Simon
"Don't try to be like Jackie. There is only one Jackie.... Study computers instead.", Jackie Chan on career choices.
animation mechanics in SVG (my first abstract photo)
|
|
|
|
|
hmmm..I'll try it.
Mazy
No sig. available now.
|
|
|
|
|
I would like to make a usercontrol with a datasource. How is this possible?
|
|
|
|
|
Inherit your control from ListControl. It contains the base implementation for binding a control to a list. If you just want to bind your control to a single value, take a look at the Control.DataBindings property.
|
|
|
|
|
Okay,
I am doing Conway's Life on my own to get familiar with doing graphic drawing. I have a picture box named world. I have a routine NewView() which will
- create a black pen (death), blue pen (birth), and red pen (living)
I was planning to just draw points on the pictureBox for each point in the 500x500 array area. Unfortunately I am lost as to just how to start out. I know I create my System.Drawing.Pen(Color.Black), etc. and I think I have to create a System.Drawing.Graphic object. But beyond that I'm lost as to the next step to have that Graphic bound to the pictureBox and having the points drawn.
Any help and tutorials that can step me through it (in C#) would be appreaciated!!!
Thanks,
MJ
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
theRealCondor wrote:
I know I create my System.Drawing.Pen(Color.Black), etc. and I think I have to create a System.Drawing.Graphic object. But beyond that I'm lost as to the next step to have that Graphic bound to the pictureBox and having the points drawn.
Override the OnPaint method and use the Graphics object provided.
leppie::AllocCPArticle(Generic DFA State Machine for .NET);
|
|
|
|
|
Well....I cannot override a method of a control in my form from my form. But that was the start of my searching.
First I hooked into the Paint event for the control and used control.Invalidate() to fire that event. It worked somewhat but I had a result that was not all that visible and I was having problems drawing points.
My second attemt did work though which I extended from the DrGUI article on doing Conway's Life.
I created a Bitmap object Bitmap img; , created a graphics object Graphics g = Graphics.FromImage(img); then I just set my pictureBox.Image = img once I drew my graphics inside the image. Works great.
Now all I have to do is get factor in form resizing, image scaling, and I have it all done!
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
Hi guys,
My application opens and saves files in a particular format. I have added the entries in the registry to associate this file type with my application (by extension). When you double-click one of these files in Windows Explorer, my application launches which is great. Now, how do I get the path of the file that was clicked? I've checked the arg[] passed into the Main method and it's not there. How do I get it so I can open the file? Also, how can I open the clicked file in a currently running instance of my application?
Thanks in advance
Andy
|
|
|
|
|
BigAndy wrote:
I've checked the arg[] passed into the Main method and it's not there.
Of course its there. Whats your code that you check it?
Mazy
No sig. available now.
|
|
|
|
|
Oh no they're no...
static void Main(string[] Args) <br />
{<br />
StreamWriter objSW = new StreamWriter("C:\\Args.txt", false);<br />
objSW.WriteLine("Args Start------");<br />
for(int x = 0; x < Args.GetLength(0); ++x)<br />
{<br />
objSW.WriteLine(Args[x]);<br />
}<br />
objSW.WriteLine("Args End------");<br />
objSW.Close();
.....
The file (Args.txt) has the "Args Start------" line and the "Args End------" line but nothing in between. Any ideas? I'm using Windows XP Pro.
Andy
|
|
|
|
|
How did you create the registered extention?
Your example works fine here.
Rocky Moore <><
|
|
|
|