🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Animation with DirectDraw

Started by
5 comments, last by Olek 24 years, 6 months ago
The easiest way I can think of, would be to use Blt and just keep expanding the detination rectangle before blitting. This would stretch it, but it might not be to pretty.

Otherwise, you'd have to set up a series of sprites, each one bigger than the last, and then write your own algortihm to Blt through the series one at a time at a specific time interval.

The first is the easiest, but the second isn't much harder (especially if you already know how to write animated sprites) and will allow you better control of the look and feel of your sprites.

Hope this helped.

Advertisement
That would work, if you do it may be worth you creating the image that is being zoomed at a much higher res than you are planning on displaying it at. Of course you could always create an animation and just show that instead
I would of thought using the stretch to be a good way of going about things, but instead of creating a small sprite and stretching it up (and consequently getting an ugly picture), how about making your sprite at the final size, and then using stretch to shrink it before you flip it to the screen.

I've never done this so I'm probably wrong.

That's very negative sounding though so I take it back.

Woop

Woop your totally right, thats how I do it, make the full size image then change the size of the destination rect and blt it. Remember you can't use bltfast with this method though.
----------------
Black Edge Games
----------------
Should I use StretchBlt function?

------------------
Olek, olo_b@poczta.onet.pl.

Olek, olo_b@poczta.onet.pl.
Lets say I have some DirectDrawSurface with bitmap loaded into it. Now, at
the beginning of my program I want to do some kind of "zooming". At the
beginning I see only a little picture which is moving in and becoming
bigger. It's done in many games but I don't know how to implement it. Any
help would be appreciated.

------------------
Olek, olo_b@poczta.onet.pl.

Olek, olo_b@poczta.onet.pl.
Just a question, this kind of magnifying doesn't sometimes produce not so good pics?
I used to have a font made out of sprites and then I would just draw them smaller in order to get other font sizes, but sometimes, for instance, half an M would disapear, reapear at a smaller size (I have a pretty good idea on why this happens, but that would be too lengthy for this)
Maybe you should use a mixed tactic, with some kind of several bitmaps at diferent sizes, and varying the dest rect to produce the in between sizes.

Second and even weirder idea: build your own blitter, but instead of for each pixel of the destination bitmap checking for the value on the origin,
make an average of every pixel in the origin that corresponds to the pixel you're filling in your destination

third ... yeah, right... and how would i do nº 2?

fourth: frankly, I'm not sure. maybe having an array of 32bit integers with the dimensions of the destination, adding each of the origin's pixels that fall into that pixel (x_dest=x_orig/scale, y_dest = y_orig/scale)and keeping record of how many pixels (in the origin)per pixel (in the destination), then dividing each value, but that sounds really sloooow....

This topic is closed to new replies.

Advertisement