Page 1 of 1

Resize pictures adapting to a work area

Posted: Wed Nov 11, 2015 2:16 pm
by Juan Carlos
I have a problem I want adapting different pictures with size more biggest than the work area of my program this has the size 640x480 but how scale the pictures to this with a good size to the picture scaled is showed perfect with scalebrush you can gire the 640x480 but some pictures are showed compressed the width or the height with a bad look
What routines can show the pictures perfectly adapted to someone the width or height but with a perfect scaling?

Re: Resize pictures adapting to a work area

Posted: Wed Nov 11, 2015 5:21 pm
by airsoftsoftwair
I guess you want to keep the aspect-ratio of the picture. You just need to calculate this on your own or pass percentage values to ScaleBrush() etc.

Re: Resize pictures adapting to a work area

Posted: Thu Nov 12, 2015 1:29 am
by Juan Carlos
I tryed several ways because for example to make a single picture viewer of 800x600 there are much pictures that have dimensions more biggest the width or height than the program 800x600 the calculate the parameters to pass to ScaleBrush is where I have the problem. Compare the width and the picture with the program size but after I don't know how determine the final with and height for show the picture correcto.

Re: Resize pictures adapting to a work area

Posted: Thu Nov 12, 2015 4:01 pm
by airsoftsoftwair
Maybe #KEEPASPRAT helps you, i.e.

Code: Select all

ScaleBrush(1, #KEEPASPRAT, 600)

or

ScaleBrush(1, 800, #KEEPASPRAT)
This will automatically calculate the other component based on brush's aspect-ratio.

Re: Resize pictures adapting to a work area

Posted: Fri Nov 13, 2015 12:21 pm
by Juan Carlos
Thanks Andreas, I no though that was so easy with the #KEEPASPRAT I worked in several routines and never got the same good success.
Again thanks.