News:

Building a 3D Ray Tracer  By stevmjon

Main Menu

Copy Images past the screen

Started by Kman1011, March 08, 2007, 05:18:54 PM

Previous topic - Next topic

Kman1011

Hi,

I was wondering if there was any way to 'GetImage' from the Scene Buffer Past the Screen limits itself?

I tried but just clips the image to the screen

imnumber=GetFreeImage()
GetImage imnumber,0,0,mapwid(1)*blocwd#,maphgt(1)*blocht#
savebitmap("Map"+Str$(imnumber)+".bmp",imnumber)
Sync
waitkey


It's just one of those 'What ifs.." :P
Ahh... Another visitor. Stay awhile....STAY FOREVER!!!...MWA-HA-HA-HA

kevin


I'm not sure I follow what you're trying to do ?

As the screen is a physical just rectangular image of whatever dimensions.   If you select 800x*600y then that's it.    Nothing exists beyond it's boundaries.

I'm assuming that you want to create a big picture of your level or something.  There's a few ways of doing it. 

You could create an image large enough to hold the world..  Then draw it all to that, or draw portions of it tot eh screen and copy screen sizes segments to the big image..

NOTE:  Please be aware this is an easy way to run your machine out of memory !!!!!!!!!!!!!!.    It'd best to create the big image as FX image, then copy the slabs to it.   If you don't enough system memory though windows will end up thrashing (swapping)  it to disc..


Kman1011

Ok....

All I wanted to do was be able to print an entire map I created

I thought I could capture an image from the entire scene buffer. Save as a bitmap, then print it out. Very difficult to check the map for errors if you can only see 5% of it. :(

So I was wondering if it is possible to either copy the map as a bitmap. (right now blocks are 160 x 160 pcx)
or shrink the size of the blocks down to just fit the screen...THEN capture.

Yes the danger of running out of memory is there so I might take the latter. just have to shrink the original image then re-cut the MapGFX or  ..... any ideas??

FYI -Playmapper classic won't submit hard copies of maps. (or will they save maps as bitmaps?)  ???
Ahh... Another visitor. Stay awhile....STAY FOREVER!!!...MWA-HA-HA-HA

kevin


  Here's a quick mock up of scaling a level. 



; make a tile
img=MakeIMage(160,160)



; Size of thelevel map
LevelWidth=100
LevelHeight=50


; Calc New block size
BlockWidth=GetSCreenWidth()/LevelWidth
BlockHeight=GetSCreenHeight()/LevelHeight

; just run through and draw it like a level
For ylp=0 to LevelHeight
Ypos=Ylp*BlockHeight
For Xlp=0 to LevelWidth
Xpos=Xlp*BlockWidth
DrawImageAT(Img,Xpos,Ypos,Xpos+BlockWidth,Ypos+Blockheight,false)
next
next

DrawImage Img,600,400,0
print BlockWidth
Print BlockHeight
sync
waitkey





Function MakeImage(Width,Height)
i=NewFXImage(Width,Height)
RenderPhongImage  i,Width/2,Height/2,rndrgb(),250,255.0/Width
EndFunction i



Function DrawImageAT(ThisImage,DestX1,DestY1,DestX2,DestY2,transparent)
w=GetIMageWidth(ThisIMage)
h=GetIMageHeight(ThisIMage)
x1=DestX1
y1=DestY1
u1=0
v1=0

x2=DestX2
y2=DestY1
u2=w
v2=0

x3=DestX2
y3=DestY2
u3=w
v3=h

x4=DestX1
y4=DestY2
u4=0
v4=h
   TextureQuad Thisimage,x1,y1,u1,v1, x2,y2,u2,v2, x3,y3,u3,v3, x4,y4,u4,v4,Transparent
EndFunction


Kman1011

#4
Yeah OK :D

That'll work. I see its simple as taking the screen width-height and dividing by the Level width-hieght

I think I would have switch 'DrawImage' with 'DrawMapBlk' and the variable 'img' would have to be aquired from 'PeekLevelTile' to get the block info. Everything else should fall into place.

And I noticed you used textureQuad. Probably very useful in 3D games like Wolfenstien.

I'll try this then

Thanx again Kevin :)
Ahh... Another visitor. Stay awhile....STAY FOREVER!!!...MWA-HA-HA-HA