Вопрос

I would like to create a picture of the ILPanel and copy it to the clipboard or save to disk. Unfortunately, I always get a white image.

Code:

Bitmap bitmap = new Bitmap(ilpnlChart.Bounds.Width, ilpnlChart.Bounds.Height);
ilpnlChart.DrawToBitmap(bitmap, ilpnlChart.Bounds);

Clipboard.SetImage(bitmap);

// TEST
bitmap.Save(@"C:\Temp\chart.jpg");
Это было полезно?

Решение

You can use an GDI or SVG renderer in order to export your scene to a static image.

Take a look at http://ilnumerics.net/offscreen-rendering.html

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top