protected Image NewImage(int width, int height, ImageBaseType baseType, ImageType type, string filename) { var image = new Image(width, height, baseType) { Filename = filename }; var layer = new Layer(image, "Background", type); image.InsertLayer(layer, 0); return(image); }
override public bool Execute() { ImageBaseType type = ImageBaseType.Rgb; // Fix me! switch (_mode.Value) { case "Grys": type = ImageBaseType.Gray; break; default: Console.WriteLine("Type: " + _mode.Value); type = ImageBaseType.Rgb; break; } int width = (int)(Parameters["Wdth"] as DoubleParameter).GetPixels(0); int height = (int)(Parameters["Hght"] as DoubleParameter).GetPixels(0); ImageType imageType; FillType fillType; switch (_fill.Value) { case "Trns": imageType = (type == ImageBaseType.Gray) ? ImageType.Graya : ImageType.Rgba; fillType = FillType.Transparent; break; default: imageType = (type == ImageBaseType.Gray) ? ImageType.Gray : ImageType.Rgb; fillType = FillType.White; break; } var image = new Image(width, height, type); var layer = new Layer(image, "Layer 1", width, height, imageType); image.InsertLayer(layer, 0); layer.Fill(fillType); ActiveImage = image; ActiveDrawable = layer; new Display(image); return(true); }
public Image(Dimensions dimensions, ImageBaseType type) : this(dimensions.Width, dimensions.Height, type) { }
public Image(int width, int height, ImageBaseType type) { ID = gimp_image_new(width, height, type); }
static extern Int32 gimp_image_new(int width, int height, ImageBaseType type);
protected Image NewImage(int width, int height, ImageBaseType baseType, ImageType type, string filename) { var image = new Image(width, height, baseType) {Filename = filename}; var layer = new Layer(image, "Background", type); image.InsertLayer(layer, 0); return image; }
public Image(Dimensions dimensions, ImageBaseType type) : this(dimensions.Width, dimensions.Height, type) { }
public Image(int width, int height, ImageBaseType type) { ID = gimp_image_new(width, height, type); }
static extern Int32 gimp_image_new(int width, int height, ImageBaseType type);