On 20/11/2013 at 06:35, xxxxxxxx wrote:
I'm creating a new material and importing an external .png file into it. I have all of that working well but I would like to get the DPI of the image that was imported. I don't see anything for c4d.BaseBitmap that allows me to get that info. I see that MultipassBitmap allows you to get the DPI but I'm having trouble getting that to work. Any help or direction is appreciated.
I pulled these lines out of the script that deal with this part.
bmp = c4d.bitmaps.BaseBitmap()
if bmp.InitWith(pathToPNGfile)[0] != c4d.IMAGERESULT_OK:
gui.MessageDialog("Please choose a valid image format.")
return
width, height = bmp.GetSize() #this gives me the dimensions of my .png file but I need to know DPI as well
mbp = c4d.bitmaps.MultipassBitmap.AllocWrapper(bmp)
print mbp.GetParameter(8) #I thought this would return the DPI but instead it prints 'None'