Notifications
Clear all

[Closed] How to support DDS with dotnet drawing bitmap

hey art, i think both ways work, I’ve had the same issue on occasion too however, have got into the habit of typing the assembly name exactly as a result.

You had any luck compiling ImageMagick? there’s supposed to be a .net wrapper for that but i’m buggered if i can make it work, even within VS. :shrug:That library will however open RLA so i’d like to see it work within Max.

Hey Pete , thanks for your share

but it’s not woking with max

dotnet.loadassembly “C:\FreeImageNET” – work
Freeimage = Dotnetclass “FreeImageAPI.Freeimage” – work
LoadFlags = Dotnetclass “FreeImageAPI.FREE_IMAGE_LOAD_FLAGS” – work
ImageFormat = Dotnetclass “FreeImageAPI.FREE_IMAGE_FORMAT” – work

– load a DDS as a .Net bitmap
DDSfile = Freeimage.LoadBitmap “C: est.dds” LoadFlags.default ImageFormat.FIF_DDSNot Work

clipboard =(dotNetClass “System.Windows.Forms.Clipboard”)

clipboard.setimage DDSFile
DDSDotNetImage = getclipboardBitmap()
Display DDSDotNetImage

I have no idea what’s wrong ,

Actually , I would want to show the bitmap texture in rollout bitmap
but the bitmap did not resize as same as the rollout size

Does anyone have any idea to make it work ?

Thank you guys

you need to download the freeimage.dll as well as the FreeimageNet.dll from the site I posted, this needs to be in your C: location also, as the Net.dll is a wrapper for this. If you have that, then are you running X64?

Hey Pete, I’m still having some trouble with DevIL.NET, I’ve managed to get FreeImageNet to work but this one I cant, can you take a look at it?

http://www.mastropaolo.com/devildotnet/

I still got this error: – Runtime error: dotNet runtime exception: Invalid directory on URL.

Pete , Thank you very much, it’s work
I was not copy the freeimage.dll to C:\

dotnet.loadassembly “C:\FreeImageNet”

Freeimage = Dotnetclass “FreeImageAPI.Freeimage”
LoadFlags = Dotnetclass “FreeImageAPI.FREE_IMAGE_LOAD_FLAGS”
ImageFormat = Dotnetclass “FreeImageAPI.FREE_IMAGE_FORMAT”

– load a DDS as a .Net bitmap
DDSfile = Freeimage.LoadBitmap “C:\ est.dds” LoadFlags.default ImageFormat.FIF_DDS

– also, you could load a TGA as a .Net bitmap if you liked.
– DDSfile = Freeimage.LoadBitmap ((getdir#scripts)+@” esttga.tga”) LoadFlags.default ImageFormat.FIF_TARGA

bmpDisplayed = dotNetObject “System.Drawing.Bitmap” DDSfile
bmpRectangle = dotNetObject “System.Drawing.Rectangle” 0 0 512 512

rollout uiDotNetPictureBox “.NET PictureBox” width:512 height:512
(
dotNetControl uiPictureBox “System.Windows.Forms.PictureBox” pos:[0,0] width:512 height:512

on uiPictureBox Paint senderArg paintEventArgs do
(
Graphics = paintEventArgs.Graphics
Graphics.DrawImage bmpDisplayed bmpRectangle
)
)
createdialog uiDotNetPictureBox style:#(#style_titlebar, #style_border, #style_sysmenu)

Hi Dave, glad to hear it!

Hey art, you have to remember, Max is using the Devil wrapper, not Devil.dll itself (a bit like in my [photoshop interop]( http://forums.cgsociety.org/showthread.php?f=98&t=756327)  article earlier in the week) 

so - 

    dotnet.loadassembly ((getdir#scripts)+"\LoneRobot\ClassLib\DevIL.NET2")
    cDevil = Dotnetclass "Devil.Devil"
    img = cDevil.LoadBitmap ((getdir#scripts)+@"	esttga.tga")
    clipboard =(dotNetClass "System.Windows.Forms.Clipboard")
    clipboard.setimage img
    ImgDotNetImage = getclipboardBitmap()
    Display ImgDotNetImage

again you need the devil.dll (and possibly ILU.dll) in the same directory to function.

Nope… Still doesnt work, I even placed the files on C:\ and nothing… :\

you’re still getting the loadassembly error?

Yeap, it’s really weird, I’ve also tried placing the files in my #scripts dir and used the same dir struct as you and nothing, same error. I’m on Windows Vista 64 btw.

hmm, can’t test that at the moment on that platform, artur – So no way of knowing. there is an x64 version of Devil now, you have got that build rather than the x86? if so, you could try downloading the source for Devil.net and recompiling it for the X64 platform, i know that wrapper existed when there was only a x86 version of devil.

edit – just checked on the devil site and i cant see a precompiled binary for the x64 platform, the link that should be that just goes to the source. I dont know C++ at all, so cant figure out how to compile it. I’ve emailed Denton Woods to see if there is one available.

one last thing, have you tried downloading the projects for devil.net

http://www.mastropaolo.com/files/DevILDotNet_sources.zip

if you can build these and run them in x86 space and max still doesnt want to work then i’m thinking it must be the 64 bit dll issue.

Page 2 / 2