Replies: 3 comments 3 replies
-
Are you trying to use it from the UI thread? |
Beta Was this translation helpful? Give feedback.
3 replies
-
I have created a draft PR so I can test if it even works correctly: #10284 |
Beta Was this translation helpful? Give feedback.
0 replies
-
What about this change to RenderTargetBitmap: /// <summary>
/// Overrides the <see cref="Bitmap"/> implementation
/// skipping the <see cref="Format"/> null check
/// </summary>
public override void CopyPixels(PixelRect sourceRect, nint buffer, int bufferSize, int stride)
{
// only check if we have a readable bitmap and if the formats are identical
// this also allows for both formats being null
if (PlatformImpl.Item is not IReadableBitmapImpl readable
|| Format != readable.Format
)
throw new NotSupportedException("CopyPixels is not supported for this bitmap type");
using (var fb = readable.Lock())
CopyPixelsCore(sourceRect, buffer, bufferSize, stride, fb);
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Avalonia.Skia.SurfaceRenderTarget
would have enough information to allow reading the bitmap content. Hence it would be possible to implementIReadableBitmapImpl
like this:That would allow to call
RenderTargetBitmap.CopyPixels()
to be used.Opinions?
Beta Was this translation helpful? Give feedback.
All reactions