Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / get image command frame sequence

Author
Message
viperjay
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: United States
Posted: 4th Apr 2004 07:29
Hi, I am having problems understanding how to get to the next image in the sequence . from what I was told so far is load the image into memory and use the command get. in order for me to know that I would need to open up paint and measure the four corners of the image. Which I have and understand but now I am having problems copying the next picture next to it. After playing around with it I found out that L and R are the x varibles is what I need to play with to move to next "frame". In this case image 1, 15, 17, 42, 41 I found out that If I add 50 to l and r I got to the frame I wanted. is there a mathmatical way of doing this or will I need to play around with each and every one of the images to make it work ?

I have attached the code that I working with and the bitmap that I am using is in the following link : http://zfgn.gunsha.com/Downloads/lttp.bmp

Thank you for your time
BearCDPOLD
20
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 4th Apr 2004 09:25
The easiest way is to go about doing it is to grab each frame out of the bmp and save them sequentially into image slots. Your animation routine would look something like this:



Crazy Donut Productions, Current Project: KillZone
Web Site Button Does Not Work, Visit Here: http://www.geocities.com/crazydonutproductions/index.html
viperjay
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: United States
Posted: 4th Apr 2004 21:30
Bear Crazy That's my problem if image 1,15,17,42,41 how do you figure out the next frame to the right ?
BearCDPOLD
20
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 4th Apr 2004 22:20
You probably can grasp the concept that when you have image frames on a bmp you can think of it as a roll of film, each image is the same size. Say you wanted to create an animation that consisted of three frames and was 72x72 pixels. Your animation file would then be 72x216.

See example:


You don't need the black lines, I just put them there for reference. So first you need to load the bitmap into memory and set the current bitmap to the one you just loaded so you can pull chunks out of it.

LOAD BIMAP "myanimation.bmp",1
SET CURRENT BITMAP 1

Next, you need to actually pull the frames out of it. You know that each frame is 72x72, so you can input the following:

GET IMAGE 1, 0,0,72,72

Which will grab the first frame and put it in image 1. Then you can finish it out. You change the first number to 72, because you want to get the part of the bitmap that is 72 pixels over, so you don't get anything from the first frame. The second number is still 0, because your Y coordinate will always start from the top. The third number will change to 144, because that is 72 pixels over from the start of frame 2. And that last number is still 72 because your bitmap is only 72 units tall.

GET IMAGE 2, 72,0,144,72

Finally.....

GET IMAGE 3, 144,0,216,72

Same concepts apply to the one just above.

Crazy Donut Productions, Current Project: KillZone
Web Site Button Does Not Work, Visit Here: http://www.geocities.com/crazydonutproductions/index.html
viperjay
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: United States
Posted: 4th Apr 2004 22:36
Bear Crazy,
1) I can't see the example you posted.
2) from get image 1, 15, 17, 42, 41 where in these numbers tell you size of the image ?


Thank you for your time
viperjay
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: United States
Posted: 5th Apr 2004 01:37
Bear Crazy,

I found out that if you x1 - x2 you will get the width and if I do y1 - y2 you would get the lenght of the image right? so once I find that out. In my case the next "frame" is right next to the image I want to copy so I would add the the x1 and x2 vaules and it will get me to the next frame it seems to work .. or is there another way of doing it ?

The other question I have is once I have a copy of it and paste is I get a white boarder around it ? is there a way to erase it ? in dbc ?

Thank you for your time
viperjay
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: United States
Posted: 9th Apr 2004 08:33
Hi,


Could some one please tell me if I am on the right track ...

Thank you

Login to post a reply

Server time is: 2024-09-22 04:40:36
Your offset time is: 2024-09-22 04:40:36