Download Now

    Reference TDrawImage

    Declared in Codebot.Controls.Extras.pas on line 40

    TDrawImage displays an image which can be desaturated or colorized
      TDrawImage = class(TSurfaceGraphicControl)
      protected
        { The color used when Colorized is true }
        procedure SetColor(Value: TColor); override;
        procedure Draw; override;
        { SharedImage if it is assigned, otherwise Image }
        property ComputeImage: TSurfaceBitmap read GetComputeImage;
      public
        { Create a new draw image }
        constructor Create(AOwner: TComponent); override;
        destructor Destroy; override;
        procedure GetPreferredSize(var PreferredWidth, PreferredHeight: integer; Raw: Boolean = False; WithThemeSpace: Boolean = True); override;
        { Discard the cached desaturated or colorized copy and repaint }
        procedure UpdateImage;
        { The area of the control covered by the image }
        property RenderArea: TRectI read GetRenderArea;
        { An image owned elsewhere which is drawn instead of Image when assigned }
        property SharedImage: TSurfaceBitmap read FSharedImage write SetSharedImage;
      published
        { The image to draw }
        property Image: TSurfaceBitmap read FImage write SetImage;
        { A rotation angle, currently unused when drawing }
        property Angle: Float read FAngle write SetAngle;
        { The image saturation from 0 for gray to 1 for full color }
        property Saturation: Float read FSaturation write SetSaturation;
        { When true the image is tinted using Color }
        property Colorized: Boolean read FColorized write SetColorized;
        { How the image is placed in the control }
        property Mode: TImageMode read FMode write SetMode;
        { The transparency of the image }
        property Opacity: Byte read GetOpacity write SetOpacity;
        property Align;
        property Anchors;
        property AutoSize;
        property BorderSpacing;
        property Constraints;
        property Color;
        property DragCursor;
        property DragMode;
        property Enabled;
        property OnChangeBounds;
        property OnClick;
        property OnDblClick;
        property OnDragDrop;
        property OnDragOver;
        property OnEndDrag;
        property OnDraw;
        property OnMouseDown;
        property OnMouseEnter;
        property OnMouseLeave;
        property OnMouseMove;
        property OnMouseUp;
        property OnMouseWheel;
        property OnMouseWheelDown;
        property OnMouseWheelUp;
        property OnResize;
        property OnStartDrag;
        property ParentShowHint;
        property PopupMenu;
        property ShowHint;
        property Visible;
      end;

    See also

    Float in Codebot.System.pas
    TColor in Codebot.Graphics.Types.pas
    TRectI in Codebot.Graphics.Types.pas
    TSurfaceBitmap in Codebot.Graphics.pas
    TSurfaceGraphicControl in Codebot.Controls.pas