User Tools

Site Tools


readme:v11.0:new-params-properties

Ability to save Params properties in a text form

Documentation | What's new & comming | v11.0

We simplified a bit Layer.Params & Shape.Params management while still keeping compatibility.

  1. New properties ParamNameAsText were introduced for Colors, Sizes, Rotations, Patterns etc. Now you can write:
    Layer.Params.Line.WidthAsText := 'SIZE:16pt';
    Layer.Params.Line.WidthAsText := 'SIZE:12m' ; // autoscaling feature
    Layer.Params.Line.WidthAsText := 'FILE:MYSIZE:12 in' ; // value are * 12 in
     
    Layer.Params.Line.ColorAsText := 'ARGB:FF00FF00';
     
    Layer.Params.Line.ColorAsText := 'RENDERER';
     
    Layer.Params.Line.ColorAsText := 'FIELD:MYCOLOR';
  2. Furthermore new properties are able to group meaning of several existing and overlapping properties. For example instead of setting Params.Area.Pattern, Params.Area.Bitmap and Params.Area.Symbol independently you can set:
    Layer.Params.Area.PatternAsText := 'STOCK:FDIAGONAL' ;
    // or
    Layer.Params.Area.PatternAsText := 'SYMBOL:c:\tmp\mysym.svg' ;
    // or
    Layer.Params.Area.PatternAsText := 'TEXTURE:c:\tmp\myfill.bmp' ;
  3. “Old” properties are still valid and used internaly. “New” properties are used for simplified management and are stored in a new .ttkpropject project file instead of old ones.
  4. Values expressed in pt, px and twips are strict values while m, mm, cm, km, in, ft, yd, mi, nm are scaled according to a viewer scale.
  5. Values expressed in dip (device independent pixels) will be scalled on all devices to represent pixels sizes accordingly to 96dpi (typical Windows screen resolution).
  6. Stock values for lines styles are: SOLID, DASH, DOT, DASHDOT, DASHDOTDOT and CLEAR.
  7. Stock values for polygon fills are: SOLID, BDIAGONAL, FDIAGONAL, CROSS, DIAGCROSS, HORIZONTAL, VERTICAL and TRANSPARENT.
  8. Stock values for marker styles are: BOX, CIRCLE, CROSS, DIAGCROSS, TRIANGLEUP, TRIANGLEDOWN, TRIANGLELEFT and TRIANGLERIGHT.
  9. TGIS_ParamsLabel.Font got a deprecated status. A new way is to use TGIS_ParamsLabel.FontName, FontSize, FontStyle & FontColor properties. Particularly important change is FontSize which uses same logic as any other “size” DK properties: positive are twips while negative are pixels. Old TGIS_ParamsLabel.Font.Size property is still valid and still in points: values are propagated to TGIS_ParamsLabel.FontSize, however only new property is capable of handling auto-scaling. Field based attributes properties FontSizeEx and FontColorEx are implement as well.
    There is .FontColorAsText and .FontSizeAsText which means that now also font sizes and colors can be rendered, auto-sized or set by field.
  10. Preferred auto-scaling sizes are now computed as:
    Layer.Params.Line.Width := -1000000000 - size_in_milimeters

    So the biggest possible autoscale value 999 km 999m 99 cm 9 mm

  11. Multiplication for auto-scaling features where never reliable:
    // works good
    Layer.Params.Line.Width := 1 ; 
    Layer.Params.Line.Width := Layer.Params.Line.Width * 2 ;
      
    // problems! due to 1000000000 added to a size
    Layer.Params.Line.WidthAsText := '1m' ;
    Layer.Params.Line.Width := Layer.Params.Line.Width * 2 ;
     
    // new helper to rescue
    Layer.Params.Line.Width := Layer.Params.Line.SizeHelper( Layer.Params.Line.Width, 2 ) ;
2017/07/05 16:21