The script below use ViewCapture.CaptureToBitmap(settings) to save bitmap from viewport.
However the TransparentBackground property is at ViewCapture Class.
I couldn’t find the Transparent property in ViewCaptureSettings Class.
Hope if there’s any suggestion.
The reason I use ViewCaptureSettings Class is because it has SetWindowRect(Point3d, Point3d) method so that it can do batch captures based on input rectangles. I couldn’t find similar method under ViewCaptrue Class.
Hey @ctu6 It’s been a little while since I’ve used this class but if memory serves me correctly I think the DrawBackground bool on ViewCaptureSettings might help you here.
@ctu6 - to output a bitmap with a transparent background, you’ll need to use ViewCapture. Before capturing to bitmap, zoom to the extends that you want to capture.
Thanks for the previous script.
I’ve tried with ViewCapture and ZoomToExtend to the desired image frame, and set the width and height 1:1 to the frame for testing.
As picture shown below, while 400x300(horizontal) the output was fine.
But when 300x400(vertical) there were white border (red area) leak out and the frame got scaled down.
Any ideas about it?