纸牌控件的编写(下)

gcysjb27h

gcysjb27h

2016-02-19 12:37

今天图老师小编要跟大家分享纸牌控件的编写(下),精心挑选的过程简单易学,喜欢的朋友一起来学习吧!

constructor TZFPlayCard.Create(AOwner: TComponent);?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

var

  x, y: integer;

begin

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/bianchengyuyan/)

  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;

 

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/bianchengyuyan/)

destructor TZFPlayCard.Destroy;

begin

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/bianchengyuyan/)

  FGlyph.Free;

  inherited;

end;

procedure TZFPlayCard.Paint;

begin

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/bianchengyuyan/)

  inherited;

  ReDraw;

end;

 

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/bianchengyuyan/)

procedure TZFPlayCard.ReDraw;

begin

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/bianchengyuyan/)

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

  if FGlyph nil then

  begin

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

  end;

end;

 

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/bianchengyuyan/)

procedure TZFPlayCard.SetCardId(const Value: TCardId);

begin

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/bianchengyuyan/)

  FCardId := Value;

  ReDraw;

end;

 

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/bianchengyuyan/)

procedure TZFPlayCard.SetCardMode(const Value: TCardMode);

begin

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/bianchengyuyan/)

  FCardMode := Value;

  ReDraw;

end;

 

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/bianchengyuyan/)

procedure TZFPlayCard.SetGlyph(const Value: TBitMap);

begin

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/bianchengyuyan/)

  if value FGlyph then

    begin

      FGlyph.Assign(value);

      Invalidate;

    end;

end;

 

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/bianchengyuyan/)

procedure TZFPlayCard.WMEraseBkgnd(var Message: TWMEraseBkgnd);

begin

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/bianchengyuyan/)

  Message.Result:=1;

end;

 

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/bianchengyuyan/)

end.

展开更多 50%)
分享

猜你喜欢

纸牌控件的编写(下)

编程语言 网络编程
纸牌控件的编写(下)

纸牌控件的编写(上)

编程语言 网络编程
纸牌控件的编写(上)

s8lol主宰符文怎么配

英雄联盟 网络游戏
s8lol主宰符文怎么配

纸牌控件的编写(中)

编程语言 网络编程
纸牌控件的编写(中)

用C#编写ActiveX控件(三)

编程语言 网络编程
用C#编写ActiveX控件(三)

lol偷钱流符文搭配推荐

英雄联盟 网络游戏
lol偷钱流符文搭配推荐

用C#编写ActiveX控件(一)

编程语言 网络编程
用C#编写ActiveX控件(一)

用C#编写ActiveX控件(二)

编程语言 网络编程
用C#编写ActiveX控件(二)

lolAD刺客新符文搭配推荐

英雄联盟
lolAD刺客新符文搭配推荐

开发一个密码查看器

开发一个密码查看器

建造者模式-Delphi述

建造者模式-Delphi述
下拉加载更多内容 ↓