I'm assuming this got deleted because I didn't specify DBP?
You can zoom in on a tilemap, sprites are resized and repositioned accordingly. It always zooms towards the center of the map, not a specific point. I might try working on that later. You could potentially use this to zoom in on an RTS map with some form of LOD or something, I don't know.
In this demo, use the mouse to move the starting point of the tilemap and the up/down keys to zoom.
type ImageScaleProperties
sprt as integer
originalWidth as integer
originalHeight as integer
originalX as integer
originalY as integer
scale as float
img as integer
endtype
load image "c:\clouds.jpg", 1
rem setup a tile map
global mapWidth = 2
global mapHeight = 2
global mapOffsetX = 0
global mapOffsetY = 0
dim map(mapWidth, mapHeight) as ImageScaleProperties
tileWidth = 128
tileHeight = 128
rem set default map properties for each scalable tile
s = 0
for y = 0 to mapHeight-1
for x = 0 to mapWidth-1
inc s,1
map(x,y).sprt = s
map(x,y).scale = 1.0
map(x,y).originalWidth = tileWidth
map(x,y).originalHeight = tileHeight
map(x,y).originalX = x*tileWidth
map(x,y).originalY = y*tileHeight
map(x,y).img = 1
sprite s, mapOffsetX+map(x,y).originalX, mapOffsetY+map(x,y).originalY, map(x,y).img
next x
next y
sync on
sync rate 60
DO
if mousemovex() or mousemovey()
mapOffsetX = mousex()
mapOffsetY = mousey()
for y = 0 to mapHeight-1
for x = 0 to mapWidth-1
gosub _resizeSprite
next x
next y
endif
if upkey()
for y = 0 to mapHeight-1
for x = 0 to mapWidth-1
map(x,y).scale = map(x,y).scale + 0.01
gosub _resizeSprite
next x
next y
endif
if downkey()
for y = 0 to mapHeight-1
for x = 0 to mapWidth-1
map(x,y).scale = map(x,y).scale - 0.01
gosub _resizeSprite
next x
next y
endif
sync
LOOP
_resizeSprite:
w# = map(x,y).originalWidth
w# = w# * map(x,y).scale
h# = map(x,y).originalHeight
h# = h# * map(x,y).scale
size sprite map(x,y).sprt, w#, h#
wx# = (w#*mapWidth - map(x,y).originalWidth*mapWidth)/2
hy# = (h#*mapHeight - map(x,y).originalHeight*mapHeight)/2
offX = x*map(x,y).originalWidth * map(x,y).scale - wx#
offY = y*map(x,y).originalHeight * map(x,y).scale - hy#
sprite map(x,y).sprt, mapOffsetX+offX, mapOffsetY+offY, map(x,y).img
RETURN