Resize pictures adapting to a work area

Find quick help here to get you started with Hollywood
Post Reply
User avatar
Juan Carlos
Posts: 452
Joined: Mon Sep 06, 2010 1:02 pm
Location: Palencia
Contact:

Resize pictures adapting to a work area

Post by Juan Carlos » Wed Nov 11, 2015 2:16 pm

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?

User avatar
airsoftsoftwair
Posts: 2668
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Resize pictures adapting to a work area

Post by airsoftsoftwair » Wed Nov 11, 2015 5:21 pm

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.

User avatar
Juan Carlos
Posts: 452
Joined: Mon Sep 06, 2010 1:02 pm
Location: Palencia
Contact:

Re: Resize pictures adapting to a work area

Post by Juan Carlos » Thu Nov 12, 2015 1:29 am

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.

User avatar
airsoftsoftwair
Posts: 2668
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Resize pictures adapting to a work area

Post by airsoftsoftwair » Thu Nov 12, 2015 4:01 pm

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.

User avatar
Juan Carlos
Posts: 452
Joined: Mon Sep 06, 2010 1:02 pm
Location: Palencia
Contact:

Re: Resize pictures adapting to a work area

Post by Juan Carlos » Fri Nov 13, 2015 12:21 pm

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.

Post Reply