Jump to content

How set background default image UNIDBImage?


Ulugbek

Recommended Posts

Hi,

 

You can create a new component based TUniCustomDBImage and override method GetBlankImageUri,

 

For example:

 

unit UniExDBImage;

 

unit UniExDBImage;

interface

uses
  System.SysUtils, System.Classes, Vcl.Controls, Vcl.Forms, uniGUIBaseClasses,
  uniGUIClasses, uniImage, uniDBImage;

type
  TUniExDBImage = class(TUniCustomDBImage)
  private
    { Private declarations }
    FBlankImageURL: string;
  protected
    { Protected declarations }
    function GetBlankImageUri: string; override;
  public
    { Public declarations }
  published
    { Published declarations }
    property DataField;
    property DataSource;

    property Center default True;
    property AutoSize;
    property Stretch;
    property Proportional;
    property Align;
    property Anchors;
    property ClientEvents;
    property Transparent;
    property ScreenMask;
    property LayoutConfig;
    property PersistentCache;
    property Draggable;

    property OnEndDrag;
    property OnClick;
    property OnDblClick;
    property OnMouseDown;
    property OnMouseUp;
    property OnMouseEnter;
    property OnMouseLeave;
    property OnResize;
    property OnAjaxEvent;

    property BlankImageURL: string read FBlankImageURL write FBlankImageURL;
  end;

procedure Register;

implementation

procedure Register;
begin
  RegisterComponents('Samples', [TUniExDBImage]);
end;

{ TUniExDBImage }

function TUniExDBImage.GetBlankImageUri: string;
begin
  Result := FBlankImageURL;
end;

end.

 

post-906-0-82488900-1453448040_thumb.png

 

post-906-0-58645500-1453448072_thumb.png

 

Best regards.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...