Hi Guys
I know this issue has been discussed on a number of threads before, but this specific issue I could not find any mention of.
I am using the following function to grab the viewport DIB:
fn getViewportDIB w h =
(
local originalSize = getViewSize()
local vpAspect = originalSize[1]/(originalSize[2] as float)
local reAspect = w as float / h
local dispSafe = displaySafeFrames
displaySafeFrames = on
local cropBox, dibW, dibH
if vpAspect/reAspect < 1 then
(
dibW = w
dibH = w / vpAspect
cropBox = box2 0 ((dibH-h)/2.) w h
)
else
(
dibW = h * vpAspect
dibH = h
cropBox = box2 ((dibW-w)/2.) 0 w h
)
gw.SetPos 0 0 dibW dibH
forceCompleteRedraw()
local dib = gw.GetViewportDIB()
local result = Bitmap w h
displaySafeFrames = dispSafe
pasteBitmap dib result cropBox [0,0] type:#paste
close dib
free dib
StatusPanel.visible = not StatusPanel.visible
StatusPanel.visible = not StatusPanel.visible
result
)
display (getViewportDib renderWidth renderHeight)
The problem is viewport backgrounds. The background does not seem to heed the call of gw.SetPos and remains the same size that it was in the original viewport.
I’ve tried InvalidateAllBackgrounds() and various redraw methods, but no luck. Any ideas?