当前位置:主页>Delphi教程>文章内容
纸牌控件的编写(下)
来源: 作者: 发布时间:2007-04-29  

constructor TZFPlayCard.Create(AOwner: TComponent);

var

  x, y: integer;

begin

  inherited Create(AOwner);

  FCardId := 1;

  cdtInit(x, y);

  SetBounds(0, 0, x, y);

  ControlStyle := [csClickEvents, csDoubleClicks];

  Enabled := True;

  Canvas.Brush.Style := bsClear;

  FGlyph := TBitMap.Create;

end;

 

destructor TZFPlayCard.Destroy;

begin

  FGlyph.Free;

  inherited;

end;

procedure TZFPlayCard.Paint;

begin

  inherited;

  ReDraw;

end;

 

procedure TZFPlayCard.ReDraw;

begin

  cdtDraw(Canvas.Handle, 0, 0, FCardId, Ord(FCardMode), clWhite);

  if FGlyph <> nil then

  begin

    canvas.StretchDraw(RECT(12, 11, 59, 85), FGlyph);

  end;

end;

 

procedure TZFPlayCard.SetCardId(const Value: TCardId);

begin

  FCardId := Value;

  ReDraw;

end;

 

procedure TZFPlayCard.SetCardMode(const Value: TCardMode);

begin

  FCardMode := Value;

  ReDraw;

end;

 

procedure TZFPlayCard.SetGlyph(const Value: TBitMap);

begin

  if value <> FGlyph then

    begin

      FGlyph.Assign(value);

      Invalidate;

    end;

end;

 

procedure TZFPlayCard.WMEraseBkgnd(var Message: TWMEraseBkgnd);

begin

  Message.Result:=1;

end;

 

end.


 
上一篇:在Delphi中开发使用多显示器的应用程序   下一篇:开发一个密码查看器
 
  相关文章
·在Delphi中开发使用多显示器的应用程序
·开发一个密码查看器
·纸牌控件的编写(中)
·编辑框和位图按钮的特殊结合
·delphi连接数据库浅谈
·如何制作平面式列头的Listview
·Delphi背后---初学者参考之二(2)
·在TDBGrid控件中为作修改过的记录进行
·纸牌控件的编写(上)
·建立、读取、存贮INI文件的方法《一》
·非COM环境下的接口编程--问题,技巧,
·一个值得大家来考虑的DLL问题
 
【关闭窗口】
推荐本站资源
最新文章