
Try 2..
Posted Tuesday, 2 June, 2009 - 19:46 by objarniOK so I got an idea, why not just put the PNG file path in the Clipboard..? Naively I typed "Clipboard" and what do you know, there is a "SetText" method in there ;)
Could it be any simpler..?
private void button1_Click(object sender, EventArgs e) { var path = Path.GetTempFileName() + ".PNG"; glControl1.GrabScreenshot().Save(path, ImageFormat.Png); Process.Start("http://www.opentk.com/node/add/blog"); // Process.Start(new FileInfo(path).DirectoryName); Clipboard.SetText(path); }
Catch: Don't know whether this works using Mono. Anyone wanna test? I'm quite satisfied with this. I don't know how to make it any simpler.
- objarni's blog
- Login or register to post comments


Comments
Re: Try 2..
It works on Mono, but the clipboard functions behaves a little differently on Linux (no idea about MacOS). Among other things, it is emptied when you close the application (so you can copy text, close the application and paste the text - you have to keep the app open throughout) and non-textual formats may not work.
Re: Try 2..
It doesn't with my setup (mono 2.0.1). I tried to paste using middle-mouse-wheel, Ctrl+V and right-click-menu.
In the blog entry field, not the upload image field.
Re: Try 2..
If you want to try, here's a .zip with the .exe. The button calls the blog-screenshot-thingie ;)
Uses OpenTK 0.9.8 binary release. Would have put it into the zip if it wouldn't have made the archive just a little too big (528 kb! 512 was max dooh!)
Re: Try 2..
Will try tomorrow. Lzma (7z) could have brought you below the limit, but it would have been a waste of bandwidth. A little annoying, granted, but this should get better once OpenTK becomes eligible for the GAC.
Re: Try 2..
Wow that's a huge difference! Approx 350kb with .7z!
.. but that didn't work because the "disc quota" was reached (2 mb). Plz Fiddler, will you give me some more quota? Or tell me how I can remove big files I've uploaded?
Re: Try 2..
Nice to see some progress. My hands are full at the moment but I'm gonna see if I find some time to help you. :)
Re: Try 2..
triton: thanks :)
Especiall platform-independancy would be great. And support for GameWindow.