open picture

How to open a picture that is a .dds format?

I guess that may depend on your use of it?

Its a format intended for DirectX applications, but you may want to convert it to a more standard format depending on what you intend to use it for and where providing you are providing those images.

Just to show the image in a image well o similar.
These images are opened by Graphic Converter without problem.

I’ve not heard of dds format, but if you want to show it in Xojo, you should convert it to something more common, such as PNG or JPG.

Yes, but can I convert it by coding?,
is complicated to transform a .dds to a .png or .jpg?
is there any one has made this code?

[quote=12506:@Enric Herrera]Yes, but can I convert it by coding?,
is complicated to transform a .dds to a .png or .jpg?
is there any one has made this code?[/quote]

Probably not. There’re C and C++ libraries you could convince (or, even better, pay) someone to turn into a plug-in you can use from within Xojo. Like http://www.mindcontrol.org/~hplus/graphics/dds-info/

[quote=12505:@Paul Lefebvre]I’ve not heard of dds format, but if you want to show it in Xojo, you should convert it to something more common, such as PNG or JPG.[/quote]It’s a format for DirectX textures, so presumably you’d be wanting to use it in some sort of directX application like a game.

[quote=12484:@Enric Herrera]Just to show the image in a image well o similar.
These images are opened by Graphic Converter without problem.[/quote]So would it not be possible to just convert it to another format which is natively supported by Xojo? Plenty of converters about.

I dont see why you are not just converting a dds to more normal format. it’s not just an “image” at the end of the day so to just “display it” like one isn’t entirely correct… http://msdn.microsoft.com/en-us/library/bb943991.aspx

You should be able to read the main surface of the format, but it’s not a normal format and there is more than just simple image data on it, so it still is yet to be answered your intended purpose? Are you making a texture viewer or what?

Hi [deleted]
I made an utility that reads the units of a game and allow to modify them and/or create new teams to design new scenarios.
The data for the units is a .csv file so no problem to work with that data. This already works, but I’d like to show also the image of the unit you’re working, these images are found in the resources of the game, and they are .dds.
So, as the utility is dynamic, i.e., reads the current game data no .csv or images are stored in my utility I’d like to show the dds.
The option to convert all ddd to a more usual format exists, (Graphic converter do) but this means a hundred images added to the utility and also every new version of the original means converting again.

Enric: ImageMagick can read but not write DDS files, you can run it on the shell from your application or try using a plugin like MBS that has ImageMagick support.

In shell, with ImageMagick, the command is easy enough: convert test.dds test.png

Using the MBS from @Christian Schmitz should help or, alternatively, he may be able to modify it so it supports convert.

http://www.monkeybreadsoftware.net/topic-imagemagick.shtml
http://www.monkeybreadsoftware.net/imagemagick-imimagembs-property.shtml#11

Sample project reading a tiff and writing it back out (I would modify the example so it exports to a different format, if I was Christian)

[quote=13175:@Eduardo Gutierrez de Oliveira]Enric: ImageMagick can read but not write DDS files, you can run it on the shell from your application or try using a plugin like MBS that has ImageMagick support.

In shell, with ImageMagick, the command is easy enough: convert test.dds test.png

Using the MBS from @Christian Schmitz should help or, alternatively, he may be able to modify it so it supports convert.

http://www.monkeybreadsoftware.net/topic-imagemagick.shtml
http://www.monkeybreadsoftware.net/imagemagick-imimagembs-property.shtml#11

Sample project reading a tiff and writing it back out (I would modify the example so it exports to a different format, if I was Christian)[/quote]

Thank you Eduardo
This opens a big door, the problem is that I do not know nothing about the shell, (it means I can call Unix commands from Xojo code?)
I’ll try to read about and investigate the Christian links.
If I find a solution I’ll post here so anyone could use.

The plugins as ImageMagic are far from my economical possibilities, I do it not for commercial purposes.
Thanks.

[quote=13164:@Enric Herrera]Hi [deleted]
I made an utility that reads the units of a game and allow to modify them and/or create new teams to design new scenarios.
The data for the units is a .csv file so no problem to work with that data. This already works, but I’d like to show also the image of the unit you’re working, these images are found in the resources of the game, and they are .dds.
So, as the utility is dynamic, i.e., reads the current game data no .csv or images are stored in my utility I’d like to show the dds.
The option to convert all ddd to a more usual format exists, (Graphic converter do) but this means a hundred images added to the utility and also every new version of the original means converting again.[/quote]Well, there is no direct library (AFAIK) in Xojo for handling .DDS.

The closest you can probably use, assuming you are targeting only windows is: http://directxtex.codeplex.com/wikipage?title=DirectXTex&referringTitle=Documentation which I believe lets you load a DDS and produce an output of it, but you will have to write the calling functions yourself with declares.

Otherwise you would have to implement the format yourself.

[quote=13327:@[deleted]]The closest you can probably use, assuming you are targeting only windows is: http://directxtex.codeplex.com/wikipage?title=DirectXTex&referringTitle=Documentation which I believe lets you load a DDS and produce an output of it, but you will have to write the calling functions yourself with declares.

Otherwise you would have to implement the format yourself.[/quote]

No, I’m targeting MacOS.
Thank for the links, full of documentation on .DDS.

Unfortunately that seems out of my scope, I’m not a so advanced programer to try to translate those .DDS specification to Xojo code.