unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids;
type
TForm1 = class(TForm)
StringGrid1: TStringGrid;
procedure FormCreate(Sender: TObject);
procedure StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
private
h: thandle;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
h := LoadLibrary('cards.dll');
end;
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
var
bmp: TBitmap;
i: integer;
begin
i := 1 + acol + ARow * StringGrid1.ColCount;
if i <= 68 then
begin
bmp := TBitmap.Create;
bmp.LoadFromResourceID(h, i);
StringGrid1.Canvas.Draw(rect.Left, rect.Top, bmp);
freeandnil(bmp);
end;
end;
end.