Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

Getting Image resolution

$
0
0

@KevMur wrote:

Hi,

I've been trying to get the resolution of an image by using xxx.getWidth() and xxx.getHeight() but it always seems to be returning 24576x24576 but the size of the image is 600x551.

This is for a college lab exercise so I have a methods in a class to retrieve both the width and the height.

//in class .cpp file
int ImageClass::imageWidth(){
image.getWidth();
}
int ImageClass::imageHeight(){
image.getHeight();
}

I am then trying to display this data by storing it in a string to be displayed.

//in ofApp.cpp file
string imageResolution = "Image Resolution: "+ofToString(image.imageWidth())+ofToString("x")+ofToString(image.imageHeight());

Any help would be appreciated.

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles