0

I have a SQLite DB full of images I need to display in Unity.

The files are stored as BLOBs and I can read the data from the DB and store it as a byte array in my C# scripts.

Unfortunately all the images are in a file format I didn't even know existed, .wmf AKA Windows Metafile, seems like it was commonly used with MS Office clip art or something? It's basically a hybrid vector graphics / raster graphics file format:

https://en.wikipedia.org/wiki/Windows_Metafile

I need to display these images in Unity. Does anyone know the best way to go about doing this?

I'd like to keep the DB and image data static, so no mass up-front conversion.

Max number of images I'd need to load, convert and display at a time is probably < 100 and definitely < 1000.

Any suggestions?

peaceoutside
  • 942
  • 7
  • 12
  • You might want to add a bit of background why you have to use images of an unsupported format in your unity project and what other potential vector formats you could use instead or as an intermediary. – Manfred Radlwimmer Feb 29 '20 at 20:49
  • If I can convert (on-the-fly) the files to SVG, that'd be ideal, since Unity supports that format, but BMP, PNG, JPG and even GIF would work. The DB of images is from a 3rd-party and I need to support the DB being updated or replaced at any time, which is why I'd like to do the conversion at run-time, as-needed. – peaceoutside Feb 29 '20 at 20:52
  • Have you tried `Texture2D` ? – merkithuseyin Feb 29 '20 at 20:53
  • @merkithuseyin yeah...it just loads an 8x8 question mark image placeholder. It looks like I need to convert .wmf to a file format the Unity supports before loading into a 2D texture. – peaceoutside Feb 29 '20 at 20:56
  • This maybe helps: https://stackoverflow.com/a/7952962/8848099 – merkithuseyin Feb 29 '20 at 20:58
  • Depending on how much time you want to put into this, WMF seems like a relative simple vector format to implement compared to SVG, Flash or AutoCAD. (Full Standard here: https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WMF/%5bMS-WMF%5d.pdf) – Manfred Radlwimmer Feb 29 '20 at 21:03
  • @merkithuseyin cool, thanks, I'll try that. – peaceoutside Feb 29 '20 at 21:03
  • I doubt that would work (System.Drawing is GDI+ based) but if it does, it would save a lot of work ; ) – Manfred Radlwimmer Feb 29 '20 at 21:06

0 Answers0