private void setImageAndPalette(PalettedImage i, Palette p) { if (!(i is PalettedImage)) { return; } if (i == null || p == null) { return; } // Console.WriteLine(i + " " + p); graphicsEditor1.setPalette(p); graphicsEditor1.setImage(i as PalettedImage); tileWidthNumber.Enabled = i is Image2D; tileOffsetNumber.Enabled = i is Image2D; fourBppCheckBox.Enabled = i is Image2D; if (i is Image2D) { tileWidthNumber.Value = (i as Image2D).width / 8; tileOffsetNumber.Value = (i as Image2D).tileOffset; fourBppCheckBox.Checked = (i as Image2D).is4bpp; } }
public void setImage(PalettedImage img) { this.imgEdit = img as PixelPalettedImage; this.img = img; DrawBuffer = new Bitmap(img.getWidth(), img.getHeight()); ZoomCache = new Bitmap(img.getWidth() * 8, img.getHeight() * 8); RenderBuffer(); SetZoomLevel(ZoomLevel); RenderZoomCache(); drawingBox.Invalidate(); }
public void addImage(PalettedImage i) { if (standalone) { i.beginEdit(); } imageListBox.Items.Add(i); if (imageListBox.Items.Count == 1) { imageListBox.SelectedItem = i; } }
private void tileWidthNumber_ValueChanged(object sender, EventArgs e) { PalettedImage i = imageListBox.SelectedItem as PalettedImage; if (i is Image2D) { (i as Image2D).width = (int)(tileWidthNumber.Value * 8); (i as Image2D).tileOffset = (int)(tileOffsetNumber.Value); (i as Image2D).is4bpp = fourBppCheckBox.Checked; graphicsEditor1.setImage(i as Image2D); updateImage(); } }