Click here to Skip to main content
14,601,062 members
Rate this:
Please Sign up or sign in to vote.
See more:
HEIF is not so new container format that allows the compression of multiple images, their colour profiles and thumbnails. Microsoft has recently added support to Windows 10 with HEIF Image Extensions that only decodes the master image in the container.

Other C++ libraries exist online like libheif allowing for more control over this type of containers.

I need help packing this library (or a similar one with such features) into a Windows Runtime Component (C++/WinRT) to be reffered in other projects (My project is a C# UWP)

What I have tried:

- I have tried packaging the source code in a new Windows Runtime Component project inside VS 2019 by importing the files: i got hundreads of errors!
- I tried using CMake GUI tool to convert leibheif into a sln project: process could not be compleated - still trying to find out the cause!
- tried opening the Cmake project in VS and edit the header file with the:
extern "C" __declspec(dllexport) struct heif_context* heif_context_alloc(void);

then tried to build the DLL file... could not call any function in my project when using the:
[DllImport("ms-appx:///libheif.dll")]

I have tried this and this and this ... for almost 6 months i have still no answer on how to approach this .... any help ? I would greatly appretiate it if someone can make an open source C# library !

p.s. I am not making projects for profit. i am just trying to make something others can find useful .. no money, advertisment or anything similar is involved.
Posted
Comments
Afzaal Ahmad Zeeshan 3-Aug-19 9:29am
   
If you want to access the C++ codes and libraries in your C#, then your best bet would be to go with C++ COM, or... Or you can write the native code in managed C++ (C++/WinRT) and access the libraries from C++/WinRT project. Then expose this C++/WinRT project as a reference for your C# project.

One thing I can recommend here, if you are looking to develop an application that relies heavily on the C++ components, then your best bet would be to develop the entire application in C++; just a suggestion!
Gerry Schmitz 3-Aug-19 10:30am
   
I have a UWP app with over 100 images "built-in" using embedded resources.

Maybe you need "HEIF"; maybe you don't.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100