Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Knowledge Base > Code Library > Paint - Graphics Editor


Reply
 
Thread Tools Display Modes
  #1  
Old 02-24-2003, 07:33 PM
Termor's Avatar
Termor Termor is offline
Contributor

* Expert *
 
Join Date: Oct 2002
Location: Illinois, USA
Posts: 569
Cool Paint - Graphics Editor


Here is a graphics editor I created which I have called Paint for lack of a better name. I created it because most of the graphics editors I found either cost too much or were for photo editing. As someone who programs a lot, I'm more interested in sprite creation not photos. So that's the urge that brought about this.

Please note that I have never really have had time to polish it as much as I would have liked, but it is still quite useable in it's current form. Heck, that's probably the reason I gave up working on it since it works so well. Just save often cause the undo can be kinda screwy sometimes.

This requires the FreeImage.dll version 2.5.2 or greater (do a search on the web to find it, or look in the comments). Before you ask, I would have included it, but that violates guidlines (imagine a Nelson "hahaaa" here). Anyway, the freeimage dll allows you to read lots of types of images, however I never worked on outputing them through the freeimage library. So this app will just spit out bmps. If anyone has the patience and time to implement saving in different formats, please send me a copy!

I can't offer much support for this as I don't have the time. Hopefully everything will be self-explainatory. Anyhoo, you'll have the code so you'll know just as much about it as I do

Anyway, on to the application.
Attached Files
File Type: zip paint.zip (102.6 KB, 742 views)
Reply With Quote
  #2  
Old 03-02-2003, 07:09 PM
Termor's Avatar
Termor Termor is offline
Contributor

* Expert *
 
Join Date: Oct 2002
Location: Illinois, USA
Posts: 569
Default

Here's a screenshot of the app in action.
Attached Images
File Type: jpg Screenshot.jpg (85.2 KB, 679 views)
Reply With Quote
  #3  
Old 03-02-2003, 07:26 PM
Volte's Avatar
Volte Volte is offline
Ultimate Contributor

Retired Leader
* Guru *
 
Join Date: Aug 2001
Posts: 5,344
Default

Holy crap... that is sweet! The only problem I could see is that I couldn't
seem to get it to open any files; it kept giving me "Unsupported file type
error -1", even on Bitmaps and GIFs.
Reply With Quote
  #4  
Old 03-02-2003, 09:10 PM
Termor's Avatar
Termor Termor is offline
Contributor

* Expert *
 
Join Date: Oct 2002
Location: Illinois, USA
Posts: 569
Default

That's what a couple people said in the graphics forum, but they never respond to me with any specifics on it Do you get the error when you drag and drop to file into the app or only when using the file - open menu? My initial guess is there is something with the freeimage.dll, but i'd like to confirm.

Oh.. and thanks for the compliment
Reply With Quote
  #5  
Old 03-02-2003, 09:55 PM
Volte's Avatar
Volte Volte is offline
Ultimate Contributor

Retired Leader
* Guru *
 
Join Date: Aug 2001
Posts: 5,344
Default

It seems to happen when I use File/Open; not totally sure about dragging,
as I haven't tried it. I'll do that tomorrow.
Reply With Quote
  #6  
Old 03-03-2003, 01:42 PM
John's Avatar
John John is offline
Bit Flipper
 
Join Date: Feb 2002
Location: The Inner Loop
Posts: 5,550
Default

Quote:
Originally Posted by VolteFace
Holy crap... that is sweet! The only problem I could see is that I couldn't
seem to get it to open any files; it kept giving me "Unsupported file type
error -1", even on Bitmaps and GIFs.
I got the same error when running the app from the VB IDE but once I compiled I was able to open the files just fine.
__________________
Subclassing|Magnetic Forms|Operator Overloading (VB2K5)|QuickSnip.NET

"These Patriot playoff wins are like Ray Charles songs, Nantucket sunsets, and hot fudge sundaes. Each one is better than the last." - Dan Shaughnessy
Reply With Quote
  #7  
Old 03-03-2003, 02:40 PM
robot313's Avatar
robot313 robot313 is offline
Senior Contributor

Retired Leader
 
Join Date: May 2001
Location: USA
Posts: 1,295
Default

I also get error -1 no matter which file I try to open and it happens with File, Open and drag and drop.
Edit: It happens both in the IDE and compiled.
Reply With Quote
  #8  
Old 03-03-2003, 04:06 PM
Termor's Avatar
Termor Termor is offline
Contributor

* Expert *
 
Join Date: Oct 2002
Location: Illinois, USA
Posts: 569
Default

I just tried running it in debug, and guess what it gave me the -1 error Anyway, I copied the freeimage.dll to C:\Windows\System32 directory and it ran fine in debug mode. Please try that and let me know if it fixes things for you.

FYI - The error occurs when the first API call is made to the dll.

Here is a link to the SourceForge entry for FreeImage.dll for those interested in it. The project was discontinued last year, but it might help someone out. I think the source code is there for downloading.

http://sourceforge.net/projects/freeimage
Reply With Quote
  #9  
Old 03-03-2003, 04:40 PM
John's Avatar
John John is offline
Bit Flipper
 
Join Date: Feb 2002
Location: The Inner Loop
Posts: 5,550
Default

I have taken out all the stuff for the FreeImage.dll in the project and reverted the frmPicture.Create back to the "old way of doing it", plus limited the types of files it can open to these: "BMP", "RLE", "GIF", "JPG", "ICO", "WMF", "EMF" and all seems to be smooth sailing right now.

The way I have it now suits my needs extremely well. You did an awesome job with it!

Thank You for sharing it with us.
Orbity
__________________
Subclassing|Magnetic Forms|Operator Overloading (VB2K5)|QuickSnip.NET

"These Patriot playoff wins are like Ray Charles songs, Nantucket sunsets, and hot fudge sundaes. Each one is better than the last." - Dan Shaughnessy
Reply With Quote
  #10  
Old 03-03-2003, 08:20 PM
Termor's Avatar
Termor Termor is offline
Contributor

* Expert *
 
Join Date: Oct 2002
Location: Illinois, USA
Posts: 569
Default

Sure take all of the fun out of it
Reply With Quote
  #11  
Old 03-04-2003, 12:23 AM
robot313's Avatar
robot313 robot313 is offline
Senior Contributor

Retired Leader
 
Join Date: May 2001
Location: USA
Posts: 1,295
Default

The dll is not even included in the download...
Reply With Quote
  #12  
Old 03-04-2003, 07:22 AM
Thinker Thinker is offline
Iron-Fisted Programmer

Retired Moderator
* Guru *
 
Join Date: Jul 2001
Location: Fayetteville Arkansas USA
Posts: 18,127
Default

Any chance you might share your modified version, Orbity?
__________________
Posting Guidelines
Reply With Quote
  #13  
Old 03-04-2003, 10:19 AM
John's Avatar
John John is offline
Bit Flipper
 
Join Date: Feb 2002
Location: The Inner Loop
Posts: 5,550
Default

Sure if it is ok with Termor.
Edit: I have PM'd Termor about it
__________________
Subclassing|Magnetic Forms|Operator Overloading (VB2K5)|QuickSnip.NET

"These Patriot playoff wins are like Ray Charles songs, Nantucket sunsets, and hot fudge sundaes. Each one is better than the last." - Dan Shaughnessy
Reply With Quote
  #14  
Old 03-04-2003, 03:29 PM
Termor's Avatar
Termor Termor is offline
Contributor

* Expert *
 
Join Date: Oct 2002
Location: Illinois, USA
Posts: 569
Default

I PM'd orbity back, I was going to work on something tonight where a person could pick (via an option dialog) if they wanted to use the dll or not. But if I don't get to it tonight, orbity is certainly free to post an improvements.

Orbity - Thanks for working on this. It's nice to know I contributed something that people found useful, even if they had to play around with it a little

Robot - I didn't include the dll as it's against forum policy. Unless an admin says it's ok to do in which case I'll include it.
Reply With Quote
  #15  
Old 03-04-2003, 03:52 PM
robot313's Avatar
robot313 robot313 is offline
Senior Contributor

Retired Leader
 
Join Date: May 2001
Location: USA
Posts: 1,295
Default

Termor: OK... I just don't understand though. How was it supposed to work then?
Reply With Quote
  #16  
Old 03-04-2003, 05:07 PM
Termor's Avatar
Termor Termor is offline
Contributor

* Expert *
 
Join Date: Oct 2002
Location: Illinois, USA
Posts: 569
Default

Here is the latest with the option to either use the dll or not. Let me know if you have any problems.

I'll try to work on it more later tonight. Any suggestions?

Robot - In one of the files it lists where to get the dll and I provided a link above. So it requires some work on the users side if they want to use the dll It's a pretty handy component, so it would probably help people out in other ways if they got it. For instance, you can use it to load png files into your game instead of using bitmaps, ect.
Attached Files
File Type: zip Paint.zip (98.7 KB, 370 views)
Reply With Quote
  #17  
Old 03-04-2003, 05:11 PM
John's Avatar
John John is offline
Bit Flipper
 
Join Date: Feb 2002
Location: The Inner Loop
Posts: 5,550
Default

Works great Termor, very nice!
__________________
Subclassing|Magnetic Forms|Operator Overloading (VB2K5)|QuickSnip.NET

"These Patriot playoff wins are like Ray Charles songs, Nantucket sunsets, and hot fudge sundaes. Each one is better than the last." - Dan Shaughnessy
Reply With Quote
  #18  
Old 03-04-2003, 08:51 PM
robot313's Avatar
robot313 robot313 is offline
Senior Contributor

Retired Leader
 
Join Date: May 2001
Location: USA
Posts: 1,295
Default

OK, it works fine now. Just one thing, the only format to save in is BMP.

Edit: By the way, I never actually said how cool this program is...it's cool

Last edited by robot313; 03-04-2003 at 11:58 PM.
Reply With Quote
  #19  
Old 03-05-2003, 03:52 PM
Termor's Avatar
Termor Termor is offline
Contributor

* Expert *
 
Join Date: Oct 2002
Location: Illinois, USA
Posts: 569
Default

Thanks When I get time I'm going to look into saving the image in different formats. The standard picturebox is wierd about that, so I'll probably need to either write custom save code or put the image back in the freeimage dll and save it through that.

Up till now, I've just been editing the images in this and saving them with photoshop if I need a different format. Since I use this mostly for sprites for games, I usually want the images in bitmap format anyway.
Reply With Quote
  #20  
Old 03-05-2003, 04:21 PM
robot313's Avatar
robot313 robot313 is offline
Senior Contributor

Retired Leader
 
Join Date: May 2001
Location: USA
Posts: 1,295
Default

Right ok, I was just noting that. I use IrfanView to convert between jpg, bmp etc..
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->