![]() |
| Manipulating Images |
|
bobum
Elvis Fanatic
![]()
|
Does anyone have any experience manipulating images within C#?
What I am trying to do is to programatically take two images and combine them into one image - but I might have to overlap one ontop of the other. Can anyone point me in the right direction with this? I've looked into some GDI+ stuff but haven't found anything yet...any tips pointers links to tutorials would be appreciated |
||||||||||||
|
|
|||||||||||||
|
Josh
Forum Regular
|
It kinda depends exactly what it is you're trying to do. You could probably figure out how to do it via a Watermaking tutorial... but instead of placing a transparencied image onto another, just just do what it is you want to do.
http://www.codeproject.com/csharp/watermark.asp?target=watermark Maybe that'll send you in the right direction... |
||||||||||||
|
|
|||||||||||||
|
bobum
Elvis Fanatic
![]()
|
This looks like it will get me going in the right direction...lemme let you in on what I am trying to do...
I am working on making a web based random map generator. I'm making a set of tiles and based on user input the program will load up a set of random tiles, and create a map for a hex based game. So the tiles are like 100px X 90px hexs with a transparent background. Since the actual image is a rectangle, yet the viewable tile is a kex, I can't just line them up in a row. I'll have to overlap and offset them to make the map one big congruent layout. Sounds pretty cool eh??? |
||||||||||||
|
|
|||||||||||||
|
bobum
Elvis Fanatic
![]()
|
Alright - I have been able to load in my individual tiles and reassemble them on the fly and save out the resulting map. It works like a charm. As long as the individual tiles are true hexagons and have a transparent background, they fit perfectly.
Now I have to move the hexes into their own class making them objects and come up with a mechanism for describing each hex with a small XML file and loading that in the class. Fun stuff! |
||||||||||||
|
|
|||||||||||||
|
Josh
Forum Regular
|
Glad that helped!!!
That sounds like quite the project, Bobum. That'll be neat to see when you're finished. Are you going to give each hex it's own XML file? You know that if you do that it's going to be a big performance hit on your app... might I suggest finding a way to utilize one xml file? At least your read/writes will only be going into one file, not hundreds... anytime you get into filesystem interaction, you're creating a hit on your app. Depending on what type of manipulation you're going to do to each file, you may be taking a serious hit. |
||||||||||||
|
|
|||||||||||||
|
bobum
Elvis Fanatic
![]()
|
Actually I should be able to do it either way...what I am going to try to do is to allow people to make "sets" of tiles - if they make a set, then they will be able to submit one large XML file containing all of the data for each tile in the set. But they should also be able to create a single tile if need be and descibe it with it's own XML file. Or, if a set is created, each tile could also have it's own XML file.
Even though it will be a performance hit initially - I think I'll flesh out the 1image:1XML part first...it should be more straightforward...then work on parsing out a large conglomerate XML file for sets. Eventually what will happen is that the program will gather the images and XML files together in a map and output a single map image and a single map XML file. The ULTIMATE goal of this app is to be able to create random maps for use in a browser based game I've been tinkering with for quite a while... |
||||||||||||
|
|
|||||||||||||
|
bobum
Elvis Fanatic
![]()
|
Serialization and deserialization is in and working - this is fun - what a geek I am...lol!
|
||||||||||||
|
|
|||||||||||||
|
bobum
Elvis Fanatic
![]()
|
ok - I've re-written what I have so far and am making this thing an MDI application. So far I have just the creation and saving of new hexes in...working on loading now...more to come...
One thing I found out is how little I REALLY do know about windows forms programming - but on the other hand I am finding out how easy it is to learn using .NET |
||||||||||||
|
|
|||||||||||||
|
Josh
Forum Regular
|
winforms *brrrrr*
I'll stick w/ my webforms. And Dreamweaver |
||||||||||||
|
|
|||||||||||||
|
bobum
Elvis Fanatic
![]()
|
Ya know - it's not really as bad as I thought. I am amuvh better judge of web design than UI design however and am fighting with how to best design the interface for this thing...SDI or MDI? Right now I made it an MDI but the deeper I get into it, the more I think I should have just gone for an SDI...maybe a tabbed SDI etc etc etc...trudging along....
|
||||||||||||
|
|
|||||||||||||
|
Josh
Forum Regular
|
Im no good at winforms programming... everything is so different it just confuses me... :s That's why I quit working as a VB programmer and started as a web app developer.
You know what I've come to discover tho? At least in my experience, those who do web dev don't really get winforms programming, and those who dev winforms dont' get web dev. And right now, web dev is the place to be because of the nondependency on platform (for the most part) |
||||||||||||
|
|
|||||||||||||
|
bobum
Elvis Fanatic
![]()
|
good point........very good point.....
And since you have all the backend functionality in web forms that you do with win forms because of .NET...I may rethink this winforms thing yet again and just do it all within a web interface.... hrmmm...... |
||||||||||||
|
|
|||||||||||||
|
bobum
Elvis Fanatic
![]()
|
The only problem with doing MY app as a web form would be the reliance for the end user to be connected to the net while actually using my app...that would make loading and saving of maps kinda klunky etc....I dunno - I'll think about it a lil more...
It's a great point though....great point... |
||||||||||||
|
|
|||||||||||||
|
Josh
Forum Regular
|
lol
It's why I started doing so many things in web dev. And being into .NET... well, enough said. I wasn't stating that yours had to be or that it should be for any reason, just that there are major differences between the two and I don't like winforms... at all. Hey, you could always finish the one you're working on, then do the really quick port to webforms, and then even make it interactive w/ other users |
||||||||||||
|
|
|||||||||||||
|
loftboy
Forum Regular
|
**** scott just use flash
the main problem with what ur doing is that if there is traffic on the site all the serialization & deserialization will create horrid amount of overhead maybe flash with .net remoting if hms has the .net version josh remind me bout those vids 2 k, i forget |
||||||||||||
|
|
|||||||||||||
| Manipulating Images |
|
||
|



