public IWindowIconImpl LoadIcon(IBitmapImpl bitmap) { var ms = new MemoryStream(); bitmap.Save(ms); return(Pixbuf.NewFromBytes(ms.ToArray())); }
public IWindowIconImpl LoadIcon(IBitmapImpl bitmap) { using (var stream = new MemoryStream()) { bitmap.Save(stream); return(LoadIcon(stream)); } }
public IWindowIconImpl LoadIcon(IBitmapImpl bitmap) { var ms = new MemoryStream(); bitmap.Save(ms); ms.Position = 0; return(LoadIcon(ms)); }
public IWindowIconImpl LoadIcon(IBitmapImpl bitmap) { var ms = new MemoryStream(); bitmap.Save(ms); ms.Seek(0, SeekOrigin.Begin); return(LoadIcon(ms)); }
public IWindowIconImpl LoadIcon(IBitmapImpl bitmap) { using (var memoryStream = new MemoryStream()) { bitmap.Save(memoryStream); return(new IconImpl(new System.Drawing.Bitmap(memoryStream))); } }
public IWindowIconImpl LoadIcon(IBitmapImpl bitmap) { using (var stream = new MemoryStream()) { bitmap.Save(stream); return LoadIcon(stream); } }
public IWindowIconImpl LoadIcon(IBitmapImpl bitmap) { if (bitmap is Gdk.Pixbuf) { return(new IconImpl((Gdk.Pixbuf)bitmap)); } else { using (var memoryStream = new MemoryStream()) { bitmap.Save(memoryStream); return(new IconImpl(new Gdk.Pixbuf(memoryStream))); } } }
public unsafe ICursorImpl CreateCursor(IBitmapImpl cursor, PixelPoint hotSpot) { using (var ms = new MemoryStream()) { cursor.Save(ms); var imageData = ms.ToArray(); fixed(void *ptr = imageData) { var avnCursor = _native.CreateCustomCursor(ptr, new IntPtr(imageData.Length), new AvnPixelSize { Width = hotSpot.X, Height = hotSpot.Y }); return(new AvaloniaNativeCursor(avnCursor)); } } }
public void Save(Stream outputStream) { _bitmap.Save(outputStream); }
private SdBitmap LoadSystemDrawingBitmap(IBitmapImpl bitmap) { using var memoryStream = new MemoryStream(); bitmap.Save(memoryStream); return(new SdBitmap(memoryStream)); }
public IWindowIconImpl LoadIcon(IBitmapImpl bitmap) { using (var memoryStream = new MemoryStream()) { bitmap.Save(memoryStream); return new IconImpl(new System.Drawing.Bitmap(memoryStream)); } }