Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to scale DIM/GET graphics...

Status
Not open for further replies.

EvilWorkZsoft

Programmer
Jun 19, 2000
5
US
I'm wondering if there is any way to scale (Ie: zoom in and out) on a sprite DIMed up to memory.  Also, frame rate efficientcy of the zoom is a factor.
 
i once tried to do this with a graphic stored in memory using the DIM command. you can certainly do&nbsp;&nbsp;it yourself but i don't see no ways to do this. you'll certainly have to PUT many graphic in memory that you zoomed yourself and then call them 1 by 1. <p>miguel<br><a href=mailto:migoul@hotmail.com>migoul@hotmail.com</a><br><a href= page (not been updated recently)</a><br>
 
ok, check it out:<br><br>get your graphic<br><br>Start a for next statement, for 10 loops<br><br>Read the original graphic pixel for pixel with the 'point' command.<br><br>Copy each pixel's x/y twice, for one pixel, the first magnification, you would have 4 pixels in a square.&nbsp;&nbsp;the second mag., 3 dots by 3 dots, for a total of 9<br><br>Last, get all you're new graphics.&nbsp;&nbsp;the best way I think to do this is add the for/next variable to the end of the graphic name (Graphic%(a)) for more then 10 zoom levels, diming the graphic name would be needed.<br><br>Once I have a stable version of this code, I'll post it.<br>
 
i did as you tell and the fastest way i found out to zoom the graphic is with the PAINT ,BF command. this is my code:<br><br>CLS<br>SCREEN 12<br>DIM SHARED graph(30), posi(20, 20)<br>CIRCLE (20, 20), 5, 14<br>PSET (20, 20), 14<br>PAINT (19, 19), 4, 14<br>LINE (15, 15)-(25, 25), 5, B<br>GET (15, 15)-(25, 25), graph<br>CLS<br>PUT (1, 1), graph<br>FOR y = 1 TO 11<br>&nbsp;&nbsp;&nbsp;&nbsp;FOR x = 1 TO 11<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;posi(x, y) = POINT(x, y)<br>&nbsp;&nbsp;&nbsp;&nbsp;NEXT<br>NEXT<br>FOR y = 1 TO 11<br>&nbsp;&nbsp;&nbsp;&nbsp;FOR x = 1 TO 11<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LINE (20 + x * 2, 20 + y * 2)-(20 + x * 2 + 2, 20 + y * 2 + 2), posi(x, y), BF<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LINE (50 + x * 4, 50 + y * 4)-(50 + x * 4 + 4, 50 + y * 4 + 4), posi(x, y), BF<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LINE (120 + x * 8, 120 + y * 8)-(120 + x * 8 + 8, 120 + y * 8 + 8), posi(x, y), BF<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LINE (240 + x * 16, 240 + y * 16)-(240 + x * 16 + 16, 240 + y * 16 + 16), posi(x, y), BF<br>&nbsp;&nbsp;&nbsp;&nbsp;NEXT<br>NEXT<br><br><br>Hope it can help you. <p>miguel<br><a href=mailto:migoul@hotmail.com>migoul@hotmail.com</a><br><a href= page (not been updated recently)</a><br>
 
I like you're idea... Actually, I put off designing it for a few days... But i just thought this up and wrote it in about 10 minutes, It is a lot smaller and simpler to use as a loading program.&nbsp;&nbsp;I just can't wait to impliment this in a game!<br><br>SCREEN 7<br>CIRCLE (5, 5), 5<br><br>FOR a = 2 TO 10<br>FOR d = 0 TO 10<br>FOR dd = 0 TO 10<br>FOR dx = 0 TO a<br>FOR dy = 0 TO a<br>PSET ((10 + (a * 10)) + ((dd * a) + dx) --cont. next line--<br>, (d * a) + dy),POINT(dd, d)<br>NEXT<br>NEXT<br>NEXT<br>NEXT<br>NEXT<br><br>
 
I just ran you're code... its quick... Much quicker then mine... I think that perhaps I could optimize the Pset equation to acomodate the 'FilledBox' system, as speed would be dramaticly increased, and code legnth would drop a few lines.
 
i have a way to do it much faster than with PSET (too long to do all the dot one by one when you are about 50 X your original graphic). with this code, it will do 1 command for each pixel of the original graphic no matter at witch zoom level it is. it's a long code but it's working very fine.<br><br>CLS<br>SCREEN 12<br>DIM graph(50), posi(20, 20)<br>LINE (15, 15)-(25, 25), 5, B<br>PAINT (16, 16), 4, 5<br>CIRCLE (20, 20), 3, 14<br>CIRCLE (20, 20), 5, 14<br>PSET (20, 20), 14<br>PAINT (19, 19), 1, 14<br>PAINT (17, 18), 2, 14<br>GET (15, 15)-(25, 25), graph<br>CLS<br>PUT (1, 1), graph<br>FOR y = 1 TO 11<br>FOR x = 1 TO 11<br>posi(x, y) = POINT(x, y)<br>NEXT: NEXT<br>CLS<br>10 FOR ok = 1 TO 40<br>FOR y = 1 TO 11<br>FOR x = 1 TO 11<br>LINE (x * ok, y * ok)-(x * ok + ok, y * ok + ok), posi(x, y), BF<br>NEXT: NEXT<br>LINE (1 * ok, 1 * ok)-(12 * ok + ok, 12 * ok + ok), 0, BF<br>NEXT<br>FOR ok = 39 TO 1 STEP -1<br>FOR y = 1 TO 11<br>FOR x = 1 TO 11<br>LINE (x * ok, y * ok)-(x * ok + ok, y * ok + ok), posi(x, y), BF<br>NEXT: NEXT<br>LINE (1 * ok, 1 * ok)-(12 * ok + ok, 12 * ok + ok), 0, BF<br>NEXT<br>GOTO 10 <p>miguel<br><a href=mailto:migoul@hotmail.com>migoul@hotmail.com</a><br><a href= page (not been updated recently)</a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top