Author Topic: getting image resolution [unsolved but unneeded]  (Read 2182 times)

Is there a method of retrieving the resolution of an image?
« Last Edit: December 27, 2014, 11:43:48 PM by otto-san »


I'm not sure what you mean. I just need to be able to determine the resolution of the given image.

I don't know of any method.

I'm not sure what you mean. I just need to be able to determine the resolution of the given image.
like, from a guibitmapctrl? or a png file?

like, from a guibitmapctrl? or a png file?
Either. The idea is that I need to have a GuiBitmapCtrl that could display an image of many different resolutions without cutting off, resizing, or wrapping. The bottom of the control will have to always be at the same level.

I think I found an alternate solution to my issue though.
« Last Edit: December 27, 2014, 11:39:28 PM by otto-san »

Either. The idea is that I need to have a GuiBitmapCtrl that could display an image of many different resolutions without cutting off, resizing, or wrapping. The bottom of the control will have to always be at the same level.
I know you solved your issue, but for anybody that finds this topic later you can enable the "lock aspect ratio" option for the bitmap control.

I know you solved your issue, but for anybody that finds this topic later you can enable the "lock aspect ratio" option for the bitmap control.
Right, the only issue is that torque will scale the image up or down to the best-fitting size for the extent of the control, which it's honestly really bad at doing.

What was the alternate solution?

What was the alternate solution?
Batch image processing, he made a topic about it earlier

Maybe you could do something with getPixelColor, checking where the image ends? I have no idea how to use it though

Maybe you could do something with getPixelColor, checking where the image ends? I have no idea how to use it though

getPixelColor(x, y) returns the normalized RGBA value at those coordinates if a bitmap is set, or on the screen if none is set.
It returns a constant value outside the boundaries, so yes, you can just algorithmically scan around for the edges.

Yeah, I considered that, but I figured it would've been pretty dumb in practice. It would have been better to make similar code in another language to actually fix the images instead if I were to do that. Though, it would read from the bitmap control and not the image, correct? So, the issue would still remain where you need to have an idea of where the image starts and stops, since it would read the wrapped or scaled image rather than the original image.

Yeah, I considered that, but I figured it would've been pretty dumb in practice. It would have been better to make similar code in another language to actually fix the images instead if I were to do that. Though, it would read from the bitmap control and not the image, correct? So, the issue would still remain where you need to have an idea of where the image starts and stops, since it would read the wrapped or scaled image rather than the original image.

I'm relatively sure that it reads from the original image.

Can't you use a third-party website?
Kind of like how Zapk's Text2Speech works.

Code: [Select]
function doTextToSpeech(%msg)
{
%this = new TCPObject(TextToSpeechConnection)
{
ttsText = %msg;
ttsFile = "";
};
%this.connect("speechutil.com:80");
}

Something i found online.
http://picresize.com/webmasters.php