public PatternGraphicsFormat(string name, PixelColorType colorType, int colorDepth, ImageLayout layout, PixelPacking packing, int defaultWidth, int defaultHeight) { Name = name; ColorType = colorType; ColorDepth = colorDepth; Layout = layout; Packing = packing; DefaultWidth = defaultWidth; DefaultHeight = defaultHeight; }
public FlowGraphicsFormat(string name, PixelColorType colorType, int colorDepth, ImageLayout layout, int defaultHeight, int defaultWidth) { Name = name; ColorType = colorType; ColorDepth = colorDepth; Layout = layout; DefaultHeight = defaultHeight; DefaultWidth = defaultWidth; Height = defaultHeight; Width = defaultWidth; }
/// <summary> /// Creates a new scattered arranger with default initialized elements /// </summary> /// <param name="layout">Layout type of the Arranger</param> /// <param name="arrangerWidth">Width of Arranger in Elements</param> /// <param name="arrangerHeight">Height of Arranger in Elements</param> /// <param name="elementWidth">Width of each element in pixels</param> /// <param name="elementHeight">Height of each element in pixels</param> /// <returns></returns> public ScatteredArranger(string name, PixelColorType colorType, ElementLayout layout, int arrangerWidth, int arrangerHeight, int elementWidth, int elementHeight) { Name = name; Mode = ArrangerMode.Scattered; Layout = layout; ColorType = colorType; if (Layout == ElementLayout.Single && (arrangerWidth != 1 || arrangerHeight != 1)) { throw new ArgumentException($"Arranger '{name}' with {ElementLayout.Single} does not have a width and height of 1"); } if (arrangerWidth <= 0 || arrangerHeight <= 0 || elementWidth <= 0 | elementHeight <= 0) { throw new ArgumentOutOfRangeException($"Arranger '{name}' does not have positive sizes for arranger and elements"); } ElementGrid = new ArrangerElement?[arrangerHeight, arrangerWidth]; ArrangerElementSize = new Size(arrangerWidth, arrangerHeight); ElementPixelSize = new Size(elementWidth, elementHeight); }