Example #1
0
 public void Init()
 {
     _image = new Image(_width, _height, ImageBaseType.Rgb) {
     {new Layer(_image, "test", _width, _height, ImageType.Rgb, 100,
        LayerModeEffects.Normal), 0}};
       _drawable = _image.ActiveDrawable;
 }
Example #2
0
        private Rectangle _rectangle; // mask bounds

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Create a GSImage backed with an existing Drawable.
        /// </summary>
        /// <param name="drawable"></param>
        public GSImage(Drawable drawable)
        {
            _image = drawable.Image;
            _drawable = drawable;
            _rectangle = _drawable.MaskBounds;
            Tile.CacheDefault(_drawable);
            Progress = new Progress("Halftone Laboratory");
        }
Example #3
0
        public void Init()
        {
            _image = new Image(_width, _height, ImageBaseType.Rgb) {
            {new Layer("test", ImageType.Rgb), 0}};

              _drawable = _image.ActiveDrawable;
              _selection = _image.Selection;
        }
Example #4
0
 /// <summary>
 /// Create a GSImage backed with a new %Gimp# Image.
 /// </summary>
 /// <param name="width"></param>
 /// <param name="height"></param>
 public GSImage(int width, int height)
 {
     _image = new Gimp.Image(width, height, ImageBaseType.Gray);
     Layer layer = new Layer(_image, "default", width, height,
         ImageType.Gray, 100, LayerModeEffects.Normal);
     _image.AddLayer(layer, 0);
     _drawable = _image.ActiveDrawable;
     _rectangle = _drawable.MaskBounds;
     Tile.CacheDefault(_drawable);
     Progress = new Progress("Halftone Laboratory");
 }
Example #5
0
        public void IsValid()
        {
            int width = 21;
              int height = 128;

              var image = new Image(width, height, ImageBaseType.Rgb) {
            {new Layer("test", ImageType.Rgb), 0}};

              var display = new Display(image);
              Assert.IsTrue(display.Valid);

              display.Delete();
              image.Delete();
              Display.DisplaysFlush();
              Assert.IsFalse(display.Valid);
        }
Example #6
0
        public void Reconnect()
        {
            int width = 21;
              int height = 128;
              var oldImage = new Image(width, height, ImageBaseType.Rgb) {
            {new Layer("test", ImageType.Rgb), 0}};
              var newImage = new Image(width, height, ImageBaseType.Rgb) {
            {new Layer("test", ImageType.Rgb), 0}};

              Assert.IsFalse(Display.Reconnect(oldImage, newImage));

              var display = new Display(oldImage);

              Assert.IsFalse(Display.Reconnect(newImage, oldImage));
              Assert.IsTrue(Display.Reconnect(oldImage, newImage));

              display.Delete();
        }
Example #7
0
        public void NewAndDelete()
        {
            int width = 21;
              int height = 128;

              var images = new ImageList();
              int count = images.Count;

              var image = new Image(width, height, ImageBaseType.Rgb) {
            {new Layer("test", ImageType.Rgb), 0}};

              Assert.AreEqual(count, images.Count);

              var display = new Display(image);
              images.Refresh();
              Assert.AreEqual(count + 1, images.Count);

              display.Delete();
              images.Refresh();

              /// Todo: the next assert fails! The number of images is still the same.
              Assert.AreEqual(count, images.Count);
              image.Delete();
        }
Example #8
0
 public void Init()
 {
     _image = new Image(_width, _height, ImageBaseType.Rgb) {
     {new Layer("test", ImageType.Rgb), 0}};
 }
 protected override void Render(Image image, Drawable drawable)
 {
     var renderer = new Renderer(Variables);
     renderer.Render(image, drawable);
 }