|
Zoom in/out |
AlexKidd
Member #7,222
May 2006
|
Could anybody please tell me the best way to zoom in and out of a background with sprites please. I know you can increase the size of a bitmap, but you cant dump the contents of a screen to a bitmap can you? |
zer0
Member #6,501
October 2005
|
You'd have to do it a different way than you're thinking. Yes, you can dump the contents of video memory into a bitmap object, but accessing it is a lot slower than accessing normal ram. So you have two choices: 2) Use your skills to figure out the position of all the sprites and the background size after zooming in and draw them. If done right this may be faster.
|
Felipe Maia
Member #6,190
September 2005
|
Just stretch the image to the size you want. |
AlexKidd
Member #7,222
May 2006
|
Im not sure i follow the buffer idea. Im quite new to Allegro, so im sure im missing the command needed. I only know how to resize a bitmap image. |
Paladin
Member #6,645
December 2005
|
stretch_blit(); should do the trick for you. If you actually wanted to resize the image, you could stretch blit the image to another bitmap, and use the other bitmap as the resized image, although I'm sure there are better methods. I was wondering how to zoom in myself so that you could utilize it for an image creation program. So the pixels are like actually 10X10. Ehh, whatever. |
AlexKidd
Member #7,222
May 2006
|
I know about the strech_blit() command. But you can only use this on a bitmap cant you? I need to zoom in and out of a screen which is randomly created at runtime. Can anyone tell me how i can do this please. |
miran
Member #2,407
June 2002
|
Like this: // World coordinates: float x_world; // Zoom factor: float zoom; // Screen coordinates: float x_screen = x_world * zoom;
-- |
AlexKidd
Member #7,222
May 2006
|
I understand that. But what command would zoom into a screen with sprites/background. Do i have to somehow dump the contents of the screen to a bitmap? |
Felipe Maia
Member #6,190
September 2005
|
You can have a dblbuffer with all the things, and then stretch_blit to the screen, or you can draw all items one by one already stretched. I don't know which method is best because I never did it. |
miran
Member #2,407
June 2002
|
Quote: I understand that. But what command would zoom into a screen with sprites/background. Do i have to somehow dump the contents of the screen to a bitmap?
Use this: And btw, screen IS a bitmap. Your questions sound very confused. -- |
A J
Member #3,025
December 2002
|
are you trying to zoom the background, yet not change the size of the sprites? ___________________________ |
|