View Full Version : MImage::resize(int, int, boolean)
11-23-2004, 07:09 PM
Does anyone know anything about the MImage object? Any advice on this is greatly appreciated. Here's the problem, I'm writing an exporter for X3D format and want to resize textures on export. Basically I've got everything working correctly except calling the resize procedure on an MImage object doesn't seem to do anything. The exported textures end up being the same size as the originals. I'm at a loss as to why. I posted on highend3d.com... nobody seemed to be able to find anything wrong with my code. I'm at a loss. The adjTexture variable is set to true, because the word "yes" prints out in the Output Window. See is my code below:
int fWidth = x3dTextureWidth;
int fHeight = x3dTextureHeight;
fImage.resize(fWidth, fHeight, false);
cout << msg << endl;
writeOutPath.operator +=(fileParts.operator (0));
writeOutPath.operator +=(fileParts.operator (1));
fImage.writeToFile(writeOutPath, fileParts.operator (1));
Any adivce someone can give on this is greatly appreciated.
11-23-2004, 08:47 PM
Well as it turns out I was using "unsigned int" when I should have been using "int".
I was using MGlobal::executeCommand in order to get the value of an int optionVar. Unfortunately for me, I was passing the the executeCommand an unsigned int, eventhought executeCommand will only accept the standard "int". Because of this, my "x3dTextureWidth" and "x3dTextureHeight" values were still null. So when I attempted to put those values in to the MImage::resize procedure, the MImage object didn't get resized.
Unfortunately, the resize procedure was returning an "MStatus::KSuccess" value, instead of a kFailure value so it was more difficult for me to track down.
So long story short - making x3dTextureWidth and x3dTextureHeight "int" instead of "unsigned int" did the trick.
01-20-2006, 12:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.