ImageSharp #17
-
Hi! Do you have any pointers on getting your library to work with ImageSharp? I've read through the documentation and am honestly quite confused, it'd be great if you could help a bit. My goal is to, on each frame update, render the frame into an ImageSharp image for use with my program. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Hi, interesting idea. You would only have to implement the So after looking at the ImageSharp documentation, your best bet would probably be, to allocate your own using (var image = Image.LoadPixelData<Rgba32>(rgbaBytes, width, height))
{
// Work with the image
} Hope that helps. |
Beta Was this translation helpful? Give feedback.
Hi, interesting idea.
You could do that by implementing your own
IRenderTarget
. For that, please see the Readme and this Avalonia-specific sample implementation:https://github.com/MarcusWichelmann/MarcusW.VncClient/blob/master/src/MarcusW.VncClient.Avalonia/RfbRenderTarget.cs#L31
You would only have to implement the
GrabFramebufferReference
method. As you can see, there it creates aWriteableBitmap
, which is also Avalonia-specific, but could be any other Bitmap implementation. All the VNC-Client implementation needs, is a pointer to the memory, where whatever Bitmap implementation stores its image.So after looking at the ImageSharp documentation, your best bet would probably be, to allo…