Table of Contents

Class ImageDataProperties

Namespace
Northwoods.Go
Assembly
Northwoods.GoDiagram.WinForms.dll

This class specifies optional properties passed to MakeImageData(ImageDataProperties).

public class ImageDataProperties
Inheritance
ImageDataProperties
Inherited Members

Properties

Background

A valid color to replace the default (transparent) background.

public string Background { get; set; }

Property Value

string

Remarks

Any padding area is also colored.

MaxSize

The maximum size of the created image, as a Size.

public Size? MaxSize { get; set; }

Property Value

Size?

Remarks

The default value is (2000, 2000) for images. This is typically used when Scale is specified and helps prevent accidental excessive memory usage, which is especially needed in limited-memory environments. You cannot use Infinity when providing a maximum size for an image.

Padding

A Margin (or number) to pad the image with.

public Margin Padding { get; set; }

Property Value

Margin

Remarks

If a size is specified, the padding will not increase the image size, it will only offset the Diagram contents within the image. The default value is a padding of 1.

Parts

A collection of GraphObjects, typically Parts, such as one from Selection or Parts.

public IEnumerable<Part> Parts { get; set; }

Property Value

IEnumerable<Part>

Remarks

If GraphObjects are specified their containing Part will be drawn. By default all Parts are drawn except temporary parts (see ShowTemporary).

Position

The position of the diagram, as a Point.

public Point? Position { get; set; }

Property Value

Point?

Remarks

By default this is the position of DocumentBounds with the Padding removed. If a specific parts collection is used, by default this is the top-left diagram position of their collective bounds. If you set a position, you should also set a Size.

Scale

The scale of the diagram.

public double? Scale { get; set; }

Property Value

double?

Remarks

If Scale is specified and Size is not, the resulting image will be sized to uniformly fit the space needed for the given scale. Can be constrained by the MaxSize property. A scale value of NaN will automatically scale to fit within the MaxSize, but may be smaller, with a maximum computed scale of 1.

ShowGrid

A boolean value, defaulting to the value of ShowTemporary, that determines whether or not the Grid Layer (containing Grid) is included in the image regardless of the value of ShowTemporary.

public bool? ShowGrid { get; set; }

Property Value

bool?

Remarks

This is useful if you want to include the grid but not adornments, or vice versa.

ShowTemporary

A boolean value, defaulting to false, that determines whether or not temporary objects such as adornments are included in the image.

public bool ShowTemporary { get; set; }

Property Value

bool

Size

The size of the created image, as a Size, limited by the MaxSize property.

public Size? Size { get; set; }

Property Value

Size?

Remarks

If no Scale or Position is specified then the diagram will be scaled to fit the given size. If you set a size, you should also set a Position. If you are scaling the diagram, you may also want to scale the size.