Started by Jonathan, March 02, 2009, 12:11:11 PM
0 Members and 1 Guest are viewing this topic.
<STAThread()> _ Public Shared Sub Main(ByVal args As String()) Try ' is there an image to convert If args.Length > 0 Then For Each a As String In args Dim fi As New FileInfo(a) Using fs As New FileStream(fi.FullName, FileMode.Open, FileAccess.Read) Dim fsh As New FSHImage(fs) Dim bi As BitmapItem = DirectCast(fsh.Bitmaps(0), BitmapItem) Dim bl As New BlendBitmap() Dim bmp As Bitmap = bl.BlendBmp(bi) bmp.Save(Path.Combine(fi.DirectoryName, String.Concat(Path.GetFileNameWithoutExtension(fi.Name), ".png"))) End Using Next Else Interaction.MsgBox("An image must be dragged onto the program to convert it", MsgBoxStyle.Information, "No image to convert") End If Catch ex As Exception Interaction.MsgBox(ex.Message, MsgBoxStyle.Critical, "Error converting file") End Try End Sub
Quote from: Jonathan on January 16, 2010, 04:11:43 PMI'm sorry I have no idea why you are getting that error, could you attach the FSH file that produced the error?
Quote from: Jonathan on February 15, 2010, 10:09:59 AMThe whole point of this tool was to make converting FSH to PNG and back to FSH again just to edit it redundant. But I got a little carried awaySo this program does the same as FSH2PNG, as well as have a proper interface.To convert FSH(s) to PNG in the same style as FSH2PNG, all you have to do is drop the FSHs onto the program icon, and hold the Control Key down as you do so. Or set the program as the default for FSH and hold Control as you open them.Another option is to use the FSHPNGConverter - Quick Convert icon. This is just a short cut to FSHPNGConverter with the command line arguement /c.If you don't hold Control down then it opens the FSHPNGConverter and puts the FSHs you dropped on the icon or opened into the list in the left.To edit a FSH without converting it back and forth (the program does this automatically for you) open it in FSHPNGConverter and the select it in the list, then click Edit in App button. This lets you select the program you want to open it in (say photoshop). After that the FSHPNGConverter dissapears and the program will load with the FSH open in it. Then When you are done click save and the close (please remember to save ). The FSHPNGConverter will reappear with the edited FSH in it. You can then click Save to save it a FSH. (So you must save it in the editing program and FSHPNGConverter )Saving the FSH:There are different Types of FSH, uncompressed/compressed and alpha/no-alpha and the combinations of the two. in FSHPNGConverter you just select Compressed or Uncompressed from the combobox at the bottom right.It will see if there is an alpha or not.The default is compressed.You can also copy the FSH as a PNG file (that you can paste into explorer) onto the clipboardOr copy the FSH as an image (that you can paste into MS paint etc) onto the clipboard.You can also drag and drop FSH/PNGs onto the listview. And the program can have PNGs dragged onto it's icon/opened with it.Jonathan
While testbmp.GetPixel(x, y).A < 255 testbmp.SetPixel(x, y, Color.FromArgb(srcpxl.A, srcpxl.A, srcpxl.A)) End While
While testbmp.GetPixel(x, y).A = 0 AndAlso testbmp.GetPixel(x, y).R = 0 testbmp.SetPixel(x, y, Color.Black) End While
Page created in 0.124 seconds with 33 queries.