SC4D Homepage
BSC File Exchange
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length


Author Topic: Simple FSH<>PNG Tools  (Read 11003 times)

0 Members and 1 Guest are viewing this topic.

Offline Jonathan

  • *
  • *
  • *
  • *
  • *
  • Posts: 2595
  • Country: gb
  • Reputation: 25
  • Gender: Male
  • CL: Einstein, Jr. &scl()
Simple FSH<>PNG Tools
« on: March 02, 2009, 02:11:11 PM »
I don't know if it's useful to anyone else, but I made it because other FSH Tools took to long, when I just quickly wanted to Convert FSH to BMP,
Just open the FSH with the Tool you get 3 buttons Bitmap Only, Bitmap and Alpha and Alpha Only, click what you want and the BMP appears almost immediately in the same location as the FSH file with the same name.
If anyone's interested post and then download the program in the attachment(includes Vista FSHLib.dll(should work on non Vista) :)



Jonathan

Sim City 4 Devotion Forums

Simple FSH<>PNG Tools
« on: March 02, 2009, 02:11:11 PM »

Re: Simple FSH to BMP tool

Offline TheTeaCat

  • *
  • *
  • *
  • Posts: 2948
  • Country: ie
  • Reputation: 25
  • Gender: Male
  • Take it easy! If you get it easy? Take it twice!
  • CL: Official Teamaker
Re: Simple FSH to BMP tool
« Reply #1 on: March 02, 2009, 02:26:34 PM »
Ohh a clever sounding little tool &apls
I'd be interested ::)

 :satisfied:
TTC
Kettle's on. Milk? Sugars?    ps I don't like Earl Grey  $%Grinno$%
Reduce, Reuse, Recycle - If you're not part of the solution , you're part of the problem!
"Never knock on Death's door: ring the bell and run away! Death really hates that!"
Tales at TeaTime      Now A proper NUT      TTC plays GRV II

Sim City 4 Devotion Forums

Re: Simple FSH to BMP tool
« Reply #1 on: March 02, 2009, 02:26:34 PM »

Re: Simple FSH to BMP tool

Offline Ennedi

Re: Simple FSH to BMP tool
« Reply #2 on: March 02, 2009, 02:36:44 PM »
Very nice, I would be interested too  :thumbsup:
New Horizons Productions
Berethor - beskhu3epnm - blade2k5 - dmscopio - dedgren - Emilin - Ennedi
jplumbley - moganite - M4346 - nichter85 - papab2000 - Shadow Assassin - Tarkus - wouanagaine

Sim City 4 Devotion Forums

Re: Simple FSH to BMP tool
« Reply #2 on: March 02, 2009, 02:36:44 PM »

Re: Simple FSH to BMP tool

Offline Andreas

  • *
  • *
  • *
  • *
  • *
  • *
  • Posts: 4061
  • Country: de
  • Reputation: 31
  • Gender: Male
    • SimCityPlaza
  • CL: ()bobby() Transit Controller
Re: Simple FSH to BMP tool
« Reply #3 on: March 02, 2009, 02:43:25 PM »
Cool. How does that work? Do you simply have to drag the FSH file onto the program window to open it, or do you have to select the file via a menu/dialogue? What about making those buttons a "hotspot" where you can drag the FSH onto, and it will be converted immediately?
Andreas

Sim City 4 Devotion Forums

Re: Simple FSH to BMP tool
« Reply #3 on: March 02, 2009, 02:43:25 PM »

Re: Simple FSH to BMP tool

Offline Jonathan

  • *
  • *
  • *
  • *
  • *
  • Posts: 2595
  • Country: gb
  • Reputation: 25
  • Gender: Male
  • CL: Einstein, Jr. &scl()
Re: Simple FSH to BMP tool
« Reply #4 on: March 02, 2009, 02:53:38 PM »
I'll just attach to the post :)
btw, it includes the Vista FSHLib.dll, but I'm not 100% sure if it works on XP.

You have to open the the FSH with the program, so like either set it as the default program or right click, open with, FSH To BMP.

But you can't open the program directly and then open the FSH File.
Hotspots is an idea, I'll try making that but I think it will be beyond my programming knowledge :)

Jonathan

Sim City 4 Devotion Forums

Re: Simple FSH to BMP tool
« Reply #4 on: March 02, 2009, 02:53:38 PM »

Re: Simple FSH to BMP tool

Offline Rayden

  • *
  • *
  • *
  • Posts: 1206
  • Country: pt
  • Reputation: 13
  • Gender: Male
  • Call me Silvio
  • CL: ()CaMsTeR()
Re: Simple FSH to BMP tool
« Reply #5 on: March 02, 2009, 03:04:49 PM »
Thx Jonathan :thumbsup:

Sim City 4 Devotion Forums

Re: Simple FSH to BMP tool
« Reply #5 on: March 02, 2009, 03:04:49 PM »

Re: Simple FSH to BMP tool

Offline Andreas

  • *
  • *
  • *
  • *
  • *
  • *
  • Posts: 4061
  • Country: de
  • Reputation: 31
  • Gender: Male
    • SimCityPlaza
  • CL: ()bobby() Transit Controller
Re: Simple FSH to BMP tool
« Reply #6 on: March 02, 2009, 03:21:34 PM »
Hotspots is an idea, I'll try making that but I think it will be beyond my programming knowledge :)

Well, any programming knowledge is beyond me, so I have no idea how complicated that could be. All I know is that such programs do exist (i. e. for converting audio files), and for converting FSH files, it seem to be a nice trick. Assigning the FSH files to your program and opening them via double-click is pretty much as fast as well, though, so there's no need to dig any further. :)
Andreas

Sim City 4 Devotion Forums

Re: Simple FSH to BMP tool
« Reply #6 on: March 02, 2009, 03:21:34 PM »

Re: Simple FSH to BMP tool

Offline wouanagaine

  • *
  • *
  • *
  • Posts: 2842
  • Country: 00
  • Reputation: 43
  • CL: :computer: SC4 CodeMaster
Re: Simple FSH to BMP tool
« Reply #7 on: March 02, 2009, 03:36:22 PM »
Nice to see more and more programmers are in :)
good job  :thumbsup:
New Horizons Productions
Berethor ♦ beskhu3epnm ♦ blade2k5 ♦ dmscopio ♦ dedgren ♦ emilin ♦ Ennedi ♦ Heblem ♦ jplumbley
M4346 ♦ moganite ♦ Papab2000 ♦ Shadow Assassin ♦ Tarkus ♦ wouanagaine
Divide wouanagaine by zero and you will in fact get one...one bad-ass that is - Alek King of SC4

Sim City 4 Devotion Forums

Re: Simple FSH to BMP tool
« Reply #7 on: March 02, 2009, 03:36:22 PM »

Re: Simple FSH to BMP tool

Offline sithlrd98

  • *
  • *
  • *
  • Posts: 1305
  • Country: us
  • Reputation: 8
  • Gender: Male
Re: Simple FSH to BMP tool
« Reply #8 on: March 02, 2009, 05:51:30 PM »
 :thumbsup: Great job Jonathan! Works as advertised (in Vista at least)! I am amazed constantly amazed  by all the things that get produced for this game!

Jayson

Sim City 4 Devotion Forums

Re: Simple FSH to BMP tool
« Reply #8 on: March 02, 2009, 05:51:30 PM »

Re: Simple FSH to BMP tool

Offline null45

  • *
  • *
  • Posts: 190
  • Country: us
  • Reputation: 17
  • Gender: Male
Re: Simple FSH to BMP tool
« Reply #9 on: March 02, 2009, 07:50:58 PM »
Works on WinXP.

It should work on Win98 or newer   :P


The vista friendly version should now have its own version number, to tell it apart from the non vista friendly versions.

The new FSHLib vista version: http://sc4devotion.com/forums/index.php?topic=5142.msg221467#msg221467


Any chance the vista friendly version can be uploaded to the LEX?

« Last Edit: March 02, 2009, 08:30:54 PM by null45 »

Sim City 4 Devotion Forums

Re: Simple FSH to BMP tool
« Reply #9 on: March 02, 2009, 07:50:58 PM »

Re: Simple FSH to BMP tool

Offline JoeST

  • *
  • ****
  • *
  • Posts: 2576
  • Country: gb
  • Reputation: 9
  • Gender: Male
  • fbstj
    • me
  • CL: Not your average...
Re: Simple FSH to BMP tool
« Reply #10 on: March 03, 2009, 04:02:48 AM »
awesome that your programming Jon :)

any chance of the code? :D

Joe
"The only thing thats impossible is the BAT, because I cant do it"
- David (dedgren)


Sim City 4 Devotion Forums

Re: Simple FSH to BMP tool
« Reply #10 on: March 03, 2009, 04:02:48 AM »

Re: Simple FSH to BMP tool

Offline Jonathan

  • *
  • *
  • *
  • *
  • *
  • Posts: 2595
  • Country: gb
  • Reputation: 25
  • Gender: Male
  • CL: Einstein, Jr. &scl()
Re: Simple FSH to BMP tool
« Reply #11 on: March 03, 2009, 11:16:50 AM »
Joe, We'll its the first thing I made I actually find useful ;)

Yep I could it's quite short (and probably not written in the best way), and its VB  :)

Jonathan

Sim City 4 Devotion Forums

Re: Simple FSH to BMP tool
« Reply #11 on: March 03, 2009, 11:16:50 AM »

Re: Simple FSH to BMP tool

Offline null45

  • *
  • *
  • Posts: 190
  • Country: us
  • Reputation: 17
  • Gender: Male
Re: Simple FSH to BMP tool
« Reply #12 on: March 04, 2009, 10:02:14 PM »
Buttons that are "hotspot" meaning you can drag & drop files onto them are fairly easy to make when using the AllowDrop file property in the Visual Studio designer.  ;)

In an demo I made the only purpose of the buttons was to drop fsh files to convert onto.  :thumbsup:

Sim City 4 Devotion Forums

Re: Simple FSH to BMP tool
« Reply #12 on: March 04, 2009, 10:02:14 PM »

Re: Simple FSH to BMP tool

Offline Jonathan

  • *
  • *
  • *
  • *
  • *
  • Posts: 2595
  • Country: gb
  • Reputation: 25
  • Gender: Male
  • CL: Einstein, Jr. &scl()
Re: Simple FSH to BMP tool
« Reply #13 on: March 05, 2009, 01:03:27 AM »
I got the dropping to work, but didn't know how to get the DropData into a Stream, and couldn't find anything about it anywhere, so I kind of gave up :)

Jonathan

Sim City 4 Devotion Forums

Re: Simple FSH to BMP tool
« Reply #13 on: March 05, 2009, 01:03:27 AM »

Re: Simple FSH to BMP tool

Offline superhands

  • *
  • *
  • *
  • *
  • Posts: 928
  • Country: 00
  • Reputation: 12
  • was bighead99
    • f u t u r e  p e r t h
  • CL: One Track Mind
Re: Simple FSH to BMP tool
« Reply #14 on: March 05, 2009, 01:13:50 AM »
nice work jon.  ;D

Sim City 4 Devotion Forums

Re: Simple FSH to BMP tool
« Reply #14 on: March 05, 2009, 01:13:50 AM »

Re: Simple FSH to BMP tool

Offline null45

  • *
  • *
  • Posts: 190
  • Country: us
  • Reputation: 17
  • Gender: Male
Re: Simple FSH to BMP tool
« Reply #15 on: March 05, 2009, 08:22:33 AM »
if it helps the code that i used for dropping is:

Code: [Select]
   private void button2_DragDrop(object sender, DragEventArgs e)
        {
            string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);

            foreach (string file in files)
            {
                FileInfo fi = new FileInfo(file);
                if (fi.Exists)
                {
                    if (fi.Extension.Equals(".fsh"))
                    {
                        FSHImage fsh = new FSHImage();
                        BitmapItem bi = new BitmapItem();
                        FileStream fstream = new FileStream(fi.FullName, FileMode.Open);

                        string path = Path.GetDirectoryName(Application.ExecutablePath);
                        fsh.Load(fstream);
                        bi = (BitmapItem)fsh.Bitmaps[0];

                        bi.Bitmap.Save(Path.Combine(path, Path.GetFileNameWithoutExtension(fi.FullName) + ".png"), ImageFormat.Png);
                        bi.Alpha.Save(Path.Combine(path, Path.GetFileNameWithoutExtension(fi.FullName) + "_a.png"), ImageFormat.Png);
                    }
                }
               
            }

        }

Sim City 4 Devotion Forums

Re: Simple FSH to BMP tool
« Reply #15 on: March 05, 2009, 08:22:33 AM »

Re: Simple FSH to BMP tool

Offline dedgren

  • *
  • *
  • *
  • *
  • *
  • *
  • *
  • *
  • *
  • Posts: 4520
  • Country: us
  • Reputation: 72
  • Gender: Male
  • rust never sleeps... neither do I
  • CL: ()law() The Weight of the Law
    SC4D Counselor
Re: Simple FSH to BMP tool
« Reply #16 on: March 05, 2009, 09:45:02 AM »
Folks, I'm getting a "This is not a valid BMP/DIB/RLE file." message in PSP when I try to open the files that are output.  Everything else appears to work as described.  I run 64-bit Vista.


David
D. Edgren

Please call me David...


Three Rivers Region- A collaborative development of the SC4 community
The 3RR Quick Finder [linkie]


I'll be back!  I am back!

Skype: davidredgren

Sim City 4 Devotion Forums

Re: Simple FSH to BMP tool
« Reply #16 on: March 05, 2009, 09:45:02 AM »

Re: Simple FSH to BMP tool

Offline Jonathan

  • *
  • *
  • *
  • *
  • *
  • Posts: 2595
  • Country: gb
  • Reputation: 25
  • Gender: Male
  • CL: Einstein, Jr. &scl()
Re: Simple FSH to BMP tool
« Reply #17 on: March 05, 2009, 11:15:09 AM »
I tried it in paint and GIMP and paint and it works, could you try it in one of them as well?

Jonathan

Sim City 4 Devotion Forums

Re: Simple FSH to BMP tool
« Reply #17 on: March 05, 2009, 11:15:09 AM »

Re: Simple FSH to BMP tool

Offline sithlrd98

  • *
  • *
  • *
  • Posts: 1305
  • Country: us
  • Reputation: 8
  • Gender: Male
Re: Simple FSH to BMP tool
« Reply #18 on: March 05, 2009, 12:23:57 PM »
That is strange,I get the same error in PSP8,Photoshop CS2 gives "could not complete your request because the file-format module cannot parse the file".
I also am on Vista 64 , the Windows photo gallery does open the file though.

Jayson


Sim City 4 Devotion Forums

Re: Simple FSH to BMP tool
« Reply #18 on: March 05, 2009, 12:23:57 PM »

Re: Simple FSH to BMP tool

Offline cogeo

  • *
  • *
  • *
  • Posts: 1066
  • Country: gr
  • Reputation: 16
  • CL:
    SC4 Station Master
Re: Simple FSH to BMP tool
« Reply #19 on: March 05, 2009, 12:40:05 PM »
I could make a new FSH->BMP tool in the weekend. It should have a batch FSH->BMP function too.

Warior, do you have any documentation of this dll (functions, arguments, description etc), and an import library? How did you know what is available in there?

Sim City 4 Devotion Forums

Re: Simple FSH to BMP tool
« Reply #19 on: March 05, 2009, 12:40:05 PM »

 


If you experience visual glitches in our site, we strongly suggest you to use Firefox to browse the forums. Also a 1024*768 or higher resolution is highly recommended to view this site