Open ShadowTeolog opened 7 years ago
You can access to pixel RGB data using the BitmapImage class.
Don't see any way now. GetPixel,SetPixel,CopyArea to another BitmapImage. No raw buffer access here. Or you tell me to use SetPixel with 1280x1024 image many times in second? In original WPF version used Media.Imaging.WriteableBitmap. WritePixels(sourceRect, sourceBuffer, sourceBufferSize, stride, (int)dirtyRect.X, (int)dirtyRect.Y); Write many times with different areas But here I can't get access to any buffer.
Yes, the only available API right now is GetPixel/SetPixel.
There is not direct buffer access in Xwt because the backends handle it in very different ways. You could retrieve the backend from Xwt.Image
by using Toolkit.CurrentEngine.GetNativeImage (Image)
and do the required operations directly on the backend object, but for this you'll need to use platform specific code (BitmapImage
in WPF, NSImage
in Cocoa and Pixbuf
in Gtk).
Currently use WrapImage from pre-rendered source. Slow, but working. Will return to this problem after few months. Toolkit.CurrentEngine.GetNativeImage returned BitmapSource only allow reading :)
For connection Xilium.CefGlue need to directly write RGB32 value to image and show it in window. But currently don't see any way for cross platform write to existing Xwt.Drawing.Image data. Curently only can get native backend and access directly using it. This make bakend lock.