123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|657|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> C/C++/C#/Other -> Need help with a C# data collection issue

Sun, 18 Nov 2007, 13:32
mindstorm8191
Hey everyone. I've been working on a kind of image editor for quite a while now, which I call SuperTurtle. The purpose of SuperTurtle is to be an image editor / creator that works by using scripts to generate the image, rather than using the mouse and a handful of tools. SuperTurtle will allow you to use classic methods to edit your image, but you can then go in and modify your image, shown as a script of actions, and alter certain parts of that. It will be like having an expanded undo system where, if you had to go back to a certain major edit and modify something there, you could still re-do everything else you did after that.

Here's an example where this would be most useful. Say I drew a circle, then blurred the edges, and then did a whole load of other edits. Then once I've finished my work, I realize I should have made the circle larger. Instead of having to do the entire process again, I could go back to where I drew the circle in the script, resize it, and run the script all the way through to where you were. Also, if someone feels that editing an image is better done simply in the script, they can do all their work there. I am hoping a system like this would make it easier for people to create artwork, especially for programming-minded people like me.

But here's the real problem: I haven't found a language that is both suitable for the intense processing required, and that provides a simple enough GUI to put this project together with. I have attempted this with Blitz, but the more I messed with that, the slower processing got. I have a pretty robust image library in Allegro (a C++ library), but I don't know of any good GUI libraries available for Allegro, and would probably not be able to make my own. (I have only today fixed a bug causing images to save in the wrong colors.)

C# sounds like the ideal language for this project, and at one point I was writing an image library for this. But then I had trouble with a rotate operation - the garbage collector worked fine for one operation, but any more and the program would stall for like 3-10 seconds at a time. I could perhaps be because I was using OpenGL with the project as well... but thinking about it now, trying to work with C#'s native image structures was quite a pain, and I really didn't know how to display the resulting images. So I was using OpenGL for displaying the results, but nobody I knew had any knowledge in using both OpenGL and C#.

Can anyone help me out? I am willing to learn a new language (something free, preferably), if they feel the language would be up to the task of my project. I unfortunately don't have a lot of time to research new languages (something that makes using C# extremely difficult), but I'm willing to shift away from my norm. If anyone knows of any GUI engines that work in OpenGL, I'll be glad to consider them as well.

-=-=-
Vesuvius web game
Sun, 18 Nov 2007, 17:46
Scherererer
Well darn, I thought this was going to be a question about DataTable's and such because of the name of the post. Instead of using OpenGL, have you taken a look at XNA? I don't know if it will help, but I believe there is better integration with C# that way. Unless you were hoping for it to run under Mono aswell, in which case, XNA wouldn't help much. Maybe it would help more if you showed us the process by which you were doing this rotation code and other processes?

-=-=-
YouTube Twitter
Computer Science Series: Logic (pt1) (part 2) (part 3) 2's Complement Mathematics: Basic Differential Calculus
Sun, 18 Nov 2007, 18:04
JL235
Java has good OpenGL support and Swing is excellent. Just like C# and so should be pretty easy to learn.

Other then that look at XNA or Managed DirectX (which is now in XNA).
Sun, 18 Nov 2007, 18:23
mindstorm8191
Well I haven't actually gotten into using XNA yet. I've used XNA a bit, but only following a tutorial, and everything there was complicated.

As far as the RotateImage operation, all I really did was, create a copy of the image as a reference, using the copy to plot new pixels on the target image, and then deleting the copied image. The image classes consisted primarily of a large array of bytes holding all the pixel data. So it doesn't make sense why it would take so long to delete the array, not the first time, but second time through.

-=-=-
Vesuvius web game
Sun, 18 Nov 2007, 18:29
JL235
How exactly is this working? Are you storing instructions or an image for each instruction or what?
Sun, 18 Nov 2007, 20:03
Nolan
I'd say stick with C#... surely the problem that you were having can be solved with help from someone well-versed in C# and OpenGL. Check on GameDev.net for help.

Swing is excellent.

If you're a masochist, sure.

-=-=-
nolandc.com
Mon, 19 Nov 2007, 01:50
power mousey

I'm sorry I can't help.
Perhaps you should follow the advice
from Nolan.

Anyway, it was a good and informative read.
Thank you and cheers.
Mon, 19 Nov 2007, 07:04
Phoenix
I've worked with Tao.OpenGL in C#, and it's a mess spiced with extra irritation through the need of writing Gl.gl in front of everything GL-related. OpenGL in C++ is much easier to work with. C++ has its own problems though.
Mon, 19 Nov 2007, 10:37
power mousey

spice or spicy?

But Yes, C++ has its own problems.

Mon, 19 Nov 2007, 18:01
mindstorm8191
Pheonix: Yeah I'm finding that problem quite often. It seems every language has its problems. C# was a very nice attempt to be a best-all-round language, but its not. The thing that makes it so difficult is the number of classes that you have to learn and use just to do simple things. "I need to throw an error." "Well, what exception class do you want to use?" And then, what I found with networking, there's a dozen similar classes for various things, each handling things a different way. There's all this information about what classes are used for, but nothing out there to explain how to do the things you want. Of course, I can put down C#, but any other language would have their own problems.

JL: I haven't got to the actual editor stage of this project yet (I first want to have a well-versed drawing library), but I plan on storing only the instructions for the image. I can then re-execute the instructions process in the background or on demand. Things may become quite processor-heavy with this, but I think I can work with that.

-=-=-
Vesuvius web game