public void ReturnsExpectedValue() { var bitmap = new Bitmap(10, 10); var adapter = new BitmapAdapter(bitmap); Assert.AreEqual(bitmap.Height, adapter.Height); }
public override void SetPixel(int x, int y, ColorRgba32 color) { _directImage.SetPixel(x + _viewX, y + _viewY, color); if (_activePencilHistory.ModifiedPoints.Add(new Point(x, y))) { IsModified = true; BitmapAdapter.Invalidate(x, y, 1, 1); } }
public void ReturnsExpectedValue() { var color = Color.FromArgb(255, 255, 235, 205); var bitmap = new Bitmap(10, 10); bitmap.SetPixel(5, 7, color); var adapter = new BitmapAdapter(bitmap); Assert.AreEqual(color, adapter.GetPixel(5, 7)); }
private static void ColorConverted(Color startColor, Color destinationColor) { // TODO: Need to moq here, but it's difficult... var bitmap = new Bitmap(1, 1); bitmap.SetPixel(0, 0, startColor); var image = new BitmapAdapter(bitmap); var itemizer = new GifItemizer(); var inventory = itemizer.Itemize <PercentagePaletteInventory>(image); Assert.IsTrue(inventory.Items.ContainsKey(destinationColor)); }
public void NoError() { var color = Color.FromArgb(255, 153, 213, 255); var bitmap = new Bitmap(1, 1); bitmap.SetPixel(0, 0, color); var adapter = new BitmapAdapter(bitmap); using (var stream = new MemoryStream()) { adapter.Save(stream, ImageFormat.Gif); var newBitmap = new Bitmap(stream); Assert.AreEqual(color, newBitmap.GetPixel(0, 0)); } }
public override void ApplyPaste(ArrangerPaste paste) { var notifyEvent = ApplyPasteInternal(paste).Match( success => { AddHistoryAction(new PasteArrangerHistoryAction(Paste)); IsModified = true; CancelOverlay(); BitmapAdapter.Invalidate(); return(new NotifyOperationEvent("Paste successfully applied")); }, fail => new NotifyOperationEvent(fail.Reason) ); _events.PublishOnUIThread(notifyEvent); }
public override void Render() => BitmapAdapter.Invalidate();