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?
Resize pictures adapting to a work area
- airsoftsoftwair
- Posts: 5443
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Resize pictures adapting to a work area
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.
- Juan Carlos
- Posts: 889
- Joined: Mon Sep 06, 2010 1:02 pm
Re: Resize pictures adapting to a work area
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.
- airsoftsoftwair
- Posts: 5443
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Resize pictures adapting to a work area
Maybe #KEEPASPRAT helps you, i.e.
This will automatically calculate the other component based on brush's aspect-ratio.
Code: Select all
ScaleBrush(1, #KEEPASPRAT, 600)
or
ScaleBrush(1, 800, #KEEPASPRAT)
- Juan Carlos
- Posts: 889
- Joined: Mon Sep 06, 2010 1:02 pm
Re: Resize pictures adapting to a work area
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.
Again thanks.