Get image from geometry

Hello ,

Can anyone tell me any way to create an image just from the inside of a geometry??

I have this Image:

I need to create an image of the circle and triangle geometry like this:


Thanks

Hi @MatrixRatrix,

It looks like you answered your own question :wink: - so what is the real question?

And then: What do you mean by ‘a geometry’? What do you mean by ‘an image’? What is the developer context here? What have you done yourself so far?

The better you can convey your requirement, the easier it will be for a forum member to help…

Regards
Jeremy

@jeremy5

sorry for the brief description i think i’m in automatic mode :rofl:

So basically I need to extract everything inside a closed object (curve) and save it as an image.

I need to do this with C# on my plugin.

  var view_capture = new ViewCapture
        {
            Width = view.ActiveViewport.Size.Width,
            Height = view.ActiveViewport.Size.Height,
            ScaleScreenItems = false,
            DrawAxes = false,
            DrawGrid = false,
            DrawGridAxes = false,
            TransparentBackground = true
        };

        var bitmap = view_capture.CaptureToBitmap(view);
        if (null != bitmap)
        {
            var path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
            var filename = Path.Combine(path, "SampleCsViewCapture.png");
            bitmap.Save(filename, System.Drawing.Imaging.ImageFormat.Png);
        }

It’s almost this example, but this example captures an image of the entire active layout, I just need to capture the image inside the closed curve.

Can you understand now?

Thanks

Hi @MatrixRatrix,

Creating an image clipped by a curve in the viewport is way beyond my capabilities, but I suspect @dale could help, or would know someone who can…

If you don’t want object’s captured, then hide them.

– Dale

Hello @dale

I can’t hide, I need to extract the content inside geometry.

Thanks

I’m confused what this means. Why don’t you extract then hide?

– Dale

Hi @dale, as I understand it the OP wants to create a bitmap image of the viewport but use an object as a clipping region…

@dale @jeremy5

Yes , that’s exactly what I want to do.

Thanks