Beispiel #1
0
        public void AddTwoDifferentLayerTypes()
        {
            var layer = new Layer(_image, "test1", ImageType.Rgb);
              _image.InsertLayer(layer, null, 0);

              var fontSize = new FontSize(32, Unit.Pixel);
              var textLayer = new TextLayer(_image, "Hello World", "Sans", fontSize);
              _image.InsertLayer(textLayer, null, 0);

              Assert.AreEqual(2, _image.Layers.Count);
              Assert.IsTrue(_image.Layers[0] is TextLayer);
              Assert.IsTrue(_image.Layers[1] is Layer);
        }
Beispiel #2
0
 public TextLayer(Image image, string text, string fontName, FontSize size) :
     base(gimp_text_layer_new(image.ID, text, fontName, size.Size, size.Unit))
 {
 }
Beispiel #3
0
 TextLayer CreateTextLayer()
 {
     var fontSize = new FontSize(32, Unit.Pixel);
       var layer = new TextLayer(_image, "Hello World", "Sans", fontSize);
       _image.InsertLayer(layer, 0);
       return layer;
 }
Beispiel #4
0
 public TextLayer(Image image, string text, string fontName, FontSize size)
     : base(gimp_text_layer_new(image.ID, text, fontName, size.Size, size.Unit))
 {
 }
Beispiel #5
0
 public void GetSetFontSize()
 {
     var fontSize = new FontSize(32, Unit.Pixel);
       var layer = new TextLayer(_image, "Hello World", "Sans", fontSize);
       _image.InsertLayer(layer, 0);
       Assert.AreEqual(fontSize, layer.FontSize);
       var newFontSize = new FontSize(1, Unit.Inch);
       layer.FontSize = newFontSize;
       Assert.AreEqual(newFontSize, layer.FontSize);
 }