public static FastCopyIntoSprite ( |
||
dest | ||
src | ||
return | void |
public Sprite Add(Bitmap src) { var rect = Allocate(src.Size); Util.FastCopyIntoSprite(rect, src); current.CommitBufferedData(); return(rect); }
public Sprite Add(Png src, float scale = 1f) { var rect = Allocate(new Size(src.Width, src.Height), scale); Util.FastCopyIntoSprite(rect, src); current.CommitBufferedData(); return(rect); }
public Sprite Add(Png src) { var rect = Allocate(new Size(src.Width, src.Height), TextureChannel.RGBA); Util.FastCopyIntoSprite(rect, src); currentSheet2D.CommitBufferedData(); return(rect); }
/// <summary> /// Сделано, только для потоков байтов типа <see cref="Png"/> . /// </summary> /// <param name="type">тип листа хранящего байты из потока</param> /// <param name="stream">поток байтов.</param> public Sheet2D(SheetType type, Stream stream) { var png = new Png(stream); Size = new Size(png.Width, png.Height); data = new byte[4 * Size.Width * Size.Height]; Util.FastCopyIntoSprite(new Sprite(this, new Rectangle(0, 0, png.Width, png.Height), TextureChannel.Red), png); Type = type; ReleaseBuffer(); }
public Sheet(SheetType type, Stream stream) { using (var bitmap = (Bitmap)Image.FromStream(stream)) { Size = bitmap.Size; data = new byte[4 * Size.Width * Size.Height]; Util.FastCopyIntoSprite(new Sprite(this, bitmap.Bounds(), TextureChannel.Red), bitmap); } Type = type; ReleaseBuffer(); }
public Sheet(string filename) { using (var stream = GlobalFileSystem.Open(filename)) using (var bitmap = (Bitmap)Image.FromStream(stream)) { Size = bitmap.Size; data = new byte[4 * Size.Width * Size.Height]; Util.FastCopyIntoSprite(new Sprite(this, bitmap.Bounds(), TextureChannel.Red), bitmap); } ReleaseBuffer(); }