|
|
导航: |
论坛 -> 信息交换
斑竹:huadugaojian,sunyesy,huangjacky |
|
作者: |
|
2024/3/11 8:57:13 |
标题: |
Iocomp中的iSwitchled不显示On和指示灯 |
浏览:227 |
|
加入我的收藏 |
楼主: |
如题
----------------------------------------------
- |
作者: |
|
2024/3/12 15:21:09 |
1楼: |
procedure TiSwitchLed.iPaintTo(Canvas: TCanvas); var DrawRect : TRect; DrawWidth : Integer; DrawHeight : Integer; LedRect : TRect; TempWidth : Integer; TempHeight : Integer; CenterPoint : TPoint; ATextRect : TRect; ATextFlags : TiTextFlags; begin CenterPoint := GetCenterPoint(Canvas); LedRect := Rect(0,0,0,0); with Canvas, DrawRect do begin DrawBackGround(Canvas, BackGroundColor); DrawBorder(Canvas);
DrawRect.Left := (FBorderSize-2); DrawRect.Top := (FBorderSize-2); DrawRect.Right := Self.Width -1 - (FBorderSize-2); DrawRect.Bottom := Self.Height -1 - (FBorderSize-2);
DrawWidth := DrawRect.Right - DrawRect.Left; DrawHeight := DrawRect.Bottom - DrawRect.Top;
Font.Assign(FCaptionFont);
Width,Height前面加上Self就可正常显示了
----------------------------------------------
-
|
|