博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
再学 GDI+[32]: TGPPen - 拐角长度的限制 - SetMiterLimit
阅读量:6605 次
发布时间:2019-06-24

本文共 1719 字,大约阅读时间需要 5 分钟。

  hot3.png

拐角长度的限制的默认值是 10.0, 一般足够用了.

本例效果图:
26153746_qes2.gif

代码文件:

unit Unit1;interfaceuses  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,  Dialogs, StdCtrls, ComCtrls;type  TForm1 = class(TForm)    TrackBar1: TTrackBar;    procedure FormPaint(Sender: TObject);    procedure ListBox1Click(Sender: TObject);    procedure TrackBar1Change(Sender: TObject);    procedure FormCreate(Sender: TObject);  end;var  Form1: TForm1;implementation{$R *.dfm}uses GDIPOBJ, GDIPAPI;procedure TForm1.FormCreate(Sender: TObject);begin  TrackBar1.ShowSelRange := False;  TrackBar1.Height := 20;  TrackBar1.Min := 0;  TrackBar1.Max := 100;  TrackBar1.Position := TrackBar1.Max;end;procedure TForm1.FormPaint(Sender: TObject);const  PtArr: array[0..2] of TGPPoint = ((X:90;Y:80), (X:240;Y:30), (X:240;Y:80));var  g: TGPGraphics;  p: TGPPen;begin  g := TGPGraphics.Create(Canvas.Handle);  p := TGPPen.Create(aclSeaGreen, 28);  p.SetMiterLimit(TrackBar1.Position / 10);  g.DrawPolygon(p, PGPPoint(@PtArr), Length(PtArr));  p.Free;  g.Free;end;procedure TForm1.ListBox1Click(Sender: TObject);begin  Repaint;end;procedure TForm1.TrackBar1Change(Sender: TObject);begin  Repaint;end;end.
窗体文件:

object Form1: TForm1  Left = 0  Top = 0  Caption = 'Form1'  ClientHeight = 138  ClientWidth = 266  Color = clBtnFace  Font.Charset = DEFAULT_CHARSET  Font.Color = clWindowText  Font.Height = -11  Font.Name = 'Tahoma'  Font.Style = []  OldCreateOrder = False  Position = poDesktopCenter  OnCreate = FormCreate  OnPaint = FormPaint  PixelsPerInch = 96  TextHeight = 13  object TrackBar1: TTrackBar    Left = 2    Top = 112    Width = 261    Height = 45    TabOrder = 0    OnChange = TrackBar1Change  endend

转载于:https://my.oschina.net/hermer/blog/320511

你可能感兴趣的文章
CS 229 notes Supervised Learning
查看>>
2018.10.27-dtoj-3996-Lesson5!(johnny)
查看>>
DataTable转换成json字符串
查看>>
RecyclerView重用导致的元素重复问题
查看>>
iOS网络协议----HTTP/TCP/IP浅析
查看>>
ubuntu 12.04 安装 redis
查看>>
IOS_CGRect
查看>>
Sql Server中不常用的表运算符之APPLY(1)
查看>>
【DM642】ICELL Interface—Cells as Algorithm Containers
查看>>
linux所有命令失效的解决办法
查看>>
力扣算法题—085最大矩阵
查看>>
svs 在创建的时候 上传文件夹 bin obj 这些不要提交
查看>>
mysql-用命令导出、导入表结构或数据
查看>>
Tinkphp
查看>>
EntityFrameworkCore 一对一 && 一对多 && 多对多配置
查看>>
How to temporally disable IDE tools (load manually)
查看>>
Vue.js学习 Item4 -- 数据双向绑定
查看>>
几种排序方式的java实现(01:插入排序,冒泡排序,选择排序,快速排序)
查看>>
server application unavailable
查看>>
浅谈尾递归的优化方式
查看>>