示例#1
0
 public Surface(PixelEditor owner)
 {
     _owner  = owner;
     _bitmap = BitmapFactory.New(owner.PixelWidth, owner.PixelHeight);
     _bitmap.Clear(Colors.Transparent);
     RenderOptions.SetBitmapScalingMode(this, BitmapScalingMode.NearestNeighbor);
     _bitmap.Changed += OnBitmapChanged;
 }
        public MainWindow()
        {
            pixelEditor = new PixelEditor(_currentWidth, _currentHeight);
            InitializeComponent();
            DataContext     = this;
            this.Closing   += MainWindow_Closing;
            pixelGrid.Child = pixelEditor;

            FrameContainer.ItemsSource = frameCollection;
            frameCollection.Add(new FrameGIF()
            {
                bitmap = pixelEditor.ToBitmap(), wbitmap = pixelEditor.GetWriteableBitmap(), Speed = "100ms"
            });
            _brushColor_Primary   = Colors.Black;
            _brushColor_Secondary = Colors.White;
            _BrushColor_Primary   = new SolidColorBrush(_brushColor_Primary);
            _BrushColor_Secondary = new SolidColorBrush(_brushColor_Secondary);

            //PixelSizeLabel = $"Pixel Size: ({pixelSizeSlider.Value/10})";


            Directory.CreateDirectory("C:/PixelCreator");
        }
示例#3
0
 private void ApplyButton_Clicked(object sender, RoutedEventArgs e)
 {
     pxE = new PixelEditor(pxE.PixelHeight, pxE.PixelHeight);
     this.Close();
 }
示例#4
0
 public ResizeWindow(ref PixelEditor pixelEditor)
 {
     InitializeComponent();
     DataContext = pixelEditor;
     pxE         = pixelEditor;
 }