I'm rendering a WPF canvas to an image and sticking it on the clipboard.
If the canvas is small (< 900px square) it all works fine.
I have a larger canvas (3000+px square) and the clipboard is empty (paste option disabled in photoshop/word etc)
var transform = canvas.LayoutTransform;
canvas.LayoutTransform = null;
var size = new Size(canvas.Width, canvas.Height);
canvas.Measure(size);
canvas.Arrange(new Rect(size));
var renderBitmap = new RenderTargetBitmap((int) size.Width, (int) size.Height, 96d, 96d, PixelFormats.Pbgra32);
renderBitmap.Render(canvas);
canvas.LayoutTransform = transform;
Clipboard.SetImage(renderBitmap);
I've not found if there is a threshold size that causes this to break.
3140 x 1903 doesnt work, 3140 x 317 does
Whats going on?
Thanks