hello :wave: I'm trying to use GDI+ from a Kotlin/...
# kotlin-native
z
hello 👋 I'm trying to use GDI+ from a Kotlin/Native project. This is the part I'm at right now: (source https://docs.microsoft.com/en-us/windows/win32/gdiplus/-gdiplus-retrieving-the-class-identifier-for-an-encoder-use)
Copy code
UINT  num = 0;          // number of image encoders
UINT  size = 0;         // size of the image encoder array in bytes
GetImageEncodersSize(&num, &size);
I'm using the
platform.gdiplus
package that seems to come by default. This is what my Kotlin code looks like:
Copy code
val num = alloc<UINTVar>()
val size = alloc<UINTVar>()
GetImageEncodersSize(num.ptr, size.ptr)
But whenever the
GetImageEncodersSize
function is called, my program crashes with the exit code
-1073741819
Am I doing something the wrong way? Thanks in advance 😄