ImageEn, unit imageenview |
|
TImageEnView.DisplayGridKind
Declaration
property DisplayGridKind: TIEGridKind;
Description
Enables the display of helper lines over the image.
Item | Description | Drawn Over |
iedgNone | No guide lines are shown | - |
iedgPixelGrid | A grid is shown marking each pixel when the image is zoomed in (e.g. for pixel editing in an image editor) | Layer 0 or DisplayGridLyr |
iedgGuideLines | Guide lines are shown horizontally and vertically over the image (e.g. to help align objects when rotating). Layout is determined by GuidelineCount | Background (Layer 0) |
iedgRulerGuides | Guide lines are shown horizontally and vertically over the image in line with label ticks of the ruler | All Control |
iedgSnapPoints | Guide points (dots) are shown horizontally and vertically over the image in line with LayersSnapDist | Background (Layer 0) |
iedgAuto | Automatically uses iedgPixelGrid, iedgGuideLines or iedgRulerGuides depending on the current view | - |
if DisplayGridKind is iedgAuto then the displayed grid is selected as follows:
◼If zoom is greater than
MinZoomDisplayGrid then iedgPixelGrid is used
◼Otherwise, if
rulers are visible then iedgRulerGuides is used
◼Otherwise, iedgGuideLines is used
Note: For performance, it is recommended to set ImageEnView1.DoubleBuffered := True;
// Automatically show guidelines based on current view
ImageEnView1.DisplayGridKind := iedgAuto;
// Draw a grid to show pixels when we zoom above 500%
IEGlobalSettings().GridPen.Color := clSilver;
IEGlobalSettings().GridPen.Style := psSolid;
IEGlobalSettings().GridPen.Mode := pmNot;
IEGlobalSettings().MinZoomDisplayGrid := 500;
ImageEnView1.DisplayGridKind := iedgPixelGrid;
// Enable guide lines to help line up images when manually rotating
IEGlobalSettings().GridPen.Color := clSilver;
IEGlobalSettings().GridPen.Style := psDot;
IEGlobalSettings().GridPen.Mode := pmCopy;
IEGlobalSettings().GuidelineCount := 4;
ImageEnView1.DisplayGridKind := iedgGuideLines;
// Draw a virtual grid of 20x20 pixels to make it easier to position and align layers
ImageEnView1.LayerOptions := ImageEnView1.LayerOptions + [ loSnapToPos ];
ImageEnView1.DoubleBuffered := True; // Improve draw performance
ImageEnView1.DisplayGridKind := iedgSnapPoints;
ImageEnView1.LayersSnapDist := 20;
ImageEnView1.Update();
See Also
◼MinZoomDisplayGrid◼GridPen◼GridMajorStep◼GuidelineCount◼DisplayGridLyr◼HighlightedPixel