I am trying to take an image from a folder to check its width after that. To do it I am using the following peace of code:
Dim pic As IPictureDisp
Dim var As Variant
var = "C:\Myfolder\Animage" & animationNum + 1 & ".png"
pic = LoadPicture(var)
It is giving me "invalid picture" error. I tried also just using the following line:
width = LoadPicture("C:\Myfolder\Animage" & animationNum + 1 & ".png").width
But it also gave me the same error. How can I load the picture?
EDIT
I try with a jpg image and it works... Does this function some issues with png files?
From msdn.microsoft.com:
Graphics formats recognized by Visual Basic include bitmap (.bmp) files, icon (.ico) files, cursor (.cur) files, run-length encoded (.rle) files, metafile (.wmf) files, enhanced metafiles (.emf), GIF (.gif) files, and JPEG (.jpg) files.
.png is not supported.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With