Ignore:
Timestamp:
Jun 23, 2019, 3:15:29 PM (5 years ago)
Author:
chronos
Message:
  • Modified: Use DpiControls package for High DPI support.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/highdpi/Packages/CevoComponents/EOTButton.pas

    r165 r178  
    44
    55uses
    6   ButtonBase, Classes, SysUtils, Graphics, LCLIntf, LCLType;
     6  ButtonBase, Classes, SysUtils, Graphics, LCLIntf, LCLType, UDpiControls;
    77
    88const
     
    1919    destructor Destroy; override;
    2020    procedure SetButtonIndexFast(x: integer);
    21     procedure SetBack(ca: TCanvas; x, y: integer);
     21    procedure SetBack(ca: TDpiCanvas; x, y: integer);
    2222  private
    23     FTemplate: TBitmap;
     23    FTemplate: TDpiBitmap;
    2424    FIndex: integer;
    2525    procedure SetIndex(x: integer);
    2626  public
    27     property Template: TBitmap read FTemplate write FTemplate;
     27    property Template: TDpiBitmap read FTemplate write FTemplate;
    2828  published
    2929    property Visible;
     
    3131    property OnClick;
    3232  protected
    33     Buffer, Back: TBitmap;
     33    Buffer, Back: TDpiBitmap;
    3434    procedure Paint; override;
    3535  end;
     
    4141procedure Register;
    4242begin
    43   RegisterComponents('C-evo', [TEOTButton]);
     43  RegisterComponents('Samples', [TEOTButton]);
    4444end;
    4545
    46 procedure ImageOp_CBC(Dst, Src: TBitmap; xDst, yDst, xSrc, ySrc, w, h, Color0,
     46procedure ImageOp_CBC(Dst, Src: TDpiBitmap; xDst, yDst, xSrc, ySrc, w, h, Color0,
    4747  Color2: integer);
    4848// Src is template
     
    9999begin
    100100  inherited;
    101   Buffer := TBitmap.Create;
     101  Buffer := TDpiBitmap.Create;
    102102  Buffer.PixelFormat := pf24bit;
    103103  Buffer.SetSize(48, 48);
    104104  Buffer.Canvas.FillRect(0, 0, Buffer.Width, Buffer.Height);
    105   Back := TBitmap.Create;
     105  Back := TDpiBitmap.Create;
    106106  Back.PixelFormat := pf24bit;
    107107  Back.SetSize(48, 48);
     
    162162end;
    163163
    164 procedure TEOTButton.SetBack(ca: TCanvas; x, y: integer);
     164procedure TEOTButton.SetBack(ca: TDpiCanvas; x, y: integer);
    165165begin
    166166  BitBlt(Back.Canvas.Handle, 0, 0, 48, 48, ca.Handle, x, y, SRCCOPY);
Note: See TracChangeset for help on using the changeset viewer.