Basically I want to read DDS files from the WWE 2K15.dat file in my program, I've searched allot of websites
to find a dll that reads dds files but came across only 2 well known ones 1. Freeimage.net 2. Devil.net if
anyone knows someone or can show me how to do this please reply on this form.
05-28-2015
8Ball
Re: Need Help Reading DDS Files from a gamesave
Devil will do it no prob.
Heres a .Net wrapper and samplecode, pay paticular attention to the loadimage sub, it's where the things of interest start to happen.
I ran it through a converter into VB for your preference. https://www.dropbox.com/s/ju06g00hmc...Devil.rar?dl=0
Try to get a feel for the code first and we'll go from there.
05-29-2015
TheLaughingClown
Re: Need Help Reading DDS Files from a gamesave
I used Devil.net but, When I reference it and debug the project it gives me an error(I am using a 64 Bit Pc).
05-29-2015
8Ball
Re: Need Help Reading DDS Files from a gamesave
what error? You will need to include the original devil dll +ilu.dll as well as the wrapper, this will likely involve manually copying them from the bin folder of what I posted. Sometimes these things are not copied over automatically when you make a reference.
You can most easily find them in "DevILNet.Sample\bin\x64\Debug", remember, all 3.
Only add the .Net wrapper as a reference, the rest just sit in your bin folders where your compiled applications go.
You also may encounter problems if you're using a lower framework to that of the wrapper but I think that's a different warning.
05-30-2015
TheLaughingClown
Re: Need Help Reading DDS Files from a gamesave
I add the wrapper but I can't see a method to open a dds file in the project
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim o As New OpenFileDialog()
o.ShowDialog()
Dim image As Image
Dim i As New ImageImporter()
image = i.LoadImage(ImageType.Dds, o.FileName)
image.Bind()
Dim info = IL.GetImageInfo()
Dim bitmap = New Bitmap(info.Width, info.Height, PixelFormat.Format32bppArgb)
Dim rect = New Rectangle(0, 0, info.Width, info.Height)
Dim data = bitmap.LockBits(rect, ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb)
IL.CopyPixels(0, 0, 0, info.Width, info.Height, 1, DataFormat.BGRA, DataType.UnsignedByte, data.Scan0)
bitmap.UnlockBits(Data)
PictureBox1.Image = bitmap
PictureBox1.Refresh()
End Sub
End Class
One thing you are going to have to keep an eye on is which arch you compile for, you will notice there are 64 and 32 bit versions of the dlls; if you mix and match it won't work.
I recommend you compile specifically for 32bit, recompile the .net dll to 32 bit and use only the 32bit dlls from the lib folder, if you were to do it for 64bit only you run the risk of cutting off people running on a potato.
The above ran perfectly for me.
There is a shorter version using these libraries DevIL.NET | Marco Mastropaolo which makes it a one liner but that just freezes if try to load a dds, don't see how thats helpful but SO disagrees.