Exemple #1
0
 /// <summary>Creates a new writeable bitmap.</summary>
 ///
 /// <param name="size">The size of the bitmap.</param>
 /// <returns>The new writeable bitmap.</returns>
 public IWriteableBitmap CreateBitmap(Point2I size)
 {
     return(ui.Invoke(() => new WpfWriteableBitmap(ui,
                                                   new WriteableBitmap(size.X, size.Y, 96, 96, PixelFormats.Bgra32, null))));
 }
Exemple #2
0
 /// <summary>Gets the bitmap's pixels.</summary>
 public Rgba32Color[] GetPixels()
 {
     Rgba32Color[] pixels = CreatePixels();
     ui.Invoke(() => Source.CopyPixels(pixels, Width * 4, 0));
     return(pixels);
 }