Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,633 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
problem: scaling a bitmap #312522
02/25/10 12:14
02/25/10 12:14
Joined: Sep 2009
Posts: 84
Theil Offline OP
Junior Member
Theil  Offline OP
Junior Member

Joined: Sep 2009
Posts: 84
Hi, I have a problem right now with lite-C, I need to resize a bitmap like stretching it, the only problem is that everytime I use scale_x or scale_y it scales the butmap just in one side, what I want to do is scale the image from everyside, here's one example:

The way I want it:



The way scale_x and scale_y is doing it



here's the code if you want to take a look:


while(complete == 0)
{
if(photo1_pan.alpha < 100)
{
photo1_pan.alpha +=0.5*time_step;
}

if(photo1_pan.scale_x < 1.1 )
{
photo1_pan.scale_x += 0.03*time_step;
photo1_pan.scale_y += 0.03*time_step;

}
if(photo1_pan.scale_x > 1 && photo1_pan.alpha > 99)
{
complete = 1;
}

wait(1);
}





I would really appreciate if someone can help me because this is for my thesis and what I want to do is some kind of cool effect, thanks for reading and I hope you can help me.

Last edited by Theil; 02/25/10 12:27.
Re: problem: scaling a bitmap [Re: Theil] #312523
02/25/10 12:45
02/25/10 12:45
Joined: Jul 2008
Posts: 894
T
TechMuc Offline
User
TechMuc  Offline
User
T

Joined: Jul 2008
Posts: 894
you have to repositionate the panel!

photo1_pan->pos_x = 500 - ((photo1_pan->scale_x - 1)/2)*bmap_width(photo1_pan->bmap);
photo1_pan->pos_y = 500 - ((photo1_pan->scale_y - 1)/2)*bmap_height(photo1_pan->bmap);

this way it should work (if 500,500 is the default position of the panel)

Re: problem: scaling a bitmap [Re: Theil] #312524
02/25/10 12:47
02/25/10 12:47
Joined: May 2009
Posts: 445
Peine, Germany
Razoron Offline
Senior Member
Razoron  Offline
Senior Member

Joined: May 2009
Posts: 445
Peine, Germany
You have to set the x and y coordinates each time you scale it.
Code:
photo1_pan.pos_x=screen_size.x/2-bmad_width(photo1_pan.bmap)/2;
photo1_pan.pos_y=screen_size.y/2-bmad_height(photo1_pan.bmap)/2;


EDIT: Damn TechMuc was faster... 1 minute 58 seconds..

Last edited by Razoron; 02/25/10 12:48.
Re: problem: scaling a bitmap [Re: Razoron] #312546
02/25/10 15:00
02/25/10 15:00
Joined: Sep 2009
Posts: 84
Theil Offline OP
Junior Member
Theil  Offline OP
Junior Member

Joined: Sep 2009
Posts: 84
Wow guys thank you, that was what I needed and you both answered really fast laugh thank you ;:)


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1