legie
01-27-2009, 05:19 PM
Hi
I need to generate screen captures of a max viewport with some information displayed in it through gw.wText. Those captured images need to be exactly a specific size. Everything works fine with
gw.setpos 0 0 previewWidth previewHeight
completeredraw()
gw.wText [2,15,0] text1 color:gray
gw.wText [tmpX,15,0] text2 color:gray
gw.updateScreen()
local viewPortBitmap = gw.getViewportDib()
viewPortBitmap.filename = previewName
save viewPortBitmap
EXCEPT the fact that the viewport background doesn't rescale with gw.setpos. Is there any way to make the background fit to the new viewport size?
Without using gw.setpos but resizing the captures image with
tmpFile = bitmap 1024 584 filename:previewName
tmpView = gw.getViewportDib()
copy tmpView tmpFile
save tmpFile
ends in a proper background in the captured image but, of course, all the gw.Text elements are then totally off through stretching...
The only solution that comes to my mind right now is to generate a camera background plate on a geometry plane to substitute the default max viewport background... But it would be great if I could just have the background re-sized after using gw.setpos 0 0 previewWidth previewHeight
I need to generate screen captures of a max viewport with some information displayed in it through gw.wText. Those captured images need to be exactly a specific size. Everything works fine with
gw.setpos 0 0 previewWidth previewHeight
completeredraw()
gw.wText [2,15,0] text1 color:gray
gw.wText [tmpX,15,0] text2 color:gray
gw.updateScreen()
local viewPortBitmap = gw.getViewportDib()
viewPortBitmap.filename = previewName
save viewPortBitmap
EXCEPT the fact that the viewport background doesn't rescale with gw.setpos. Is there any way to make the background fit to the new viewport size?
Without using gw.setpos but resizing the captures image with
tmpFile = bitmap 1024 584 filename:previewName
tmpView = gw.getViewportDib()
copy tmpView tmpFile
save tmpFile
ends in a proper background in the captured image but, of course, all the gw.Text elements are then totally off through stretching...
The only solution that comes to my mind right now is to generate a camera background plate on a geometry plane to substitute the default max viewport background... But it would be great if I could just have the background re-sized after using gw.setpos 0 0 previewWidth previewHeight
