SetLineCapStyle
IPDFDocument4 :: Page Operations :: Graphics

See Also Example
Collapse All

This method configures the line end style for an open sub-path.

Syntax

HRESULT SetLineCapStyle (
LineCapStyle lineCap
)
Parameters
lineCap
Style of the line cap

Return value
If successful, this method returns S_OK. If it fails, this method should return one of the error values.

Remarks

This method sets the style of the shape to be used at the ends of open sub-paths and dashes, if any, when the sub-paths are stroked.

Example

Line Cap Styles

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
PDF.SetLineWidth(10);

PDF.SetLineCapStyle(lcsButtEnd);
PDF.MoveTo(30, 30);
PDF.DrawLineTo(130, 30);
PDF.Stroke;

PDF.SetLineCapStyle(lcsRound);
PDF.MoveTo(30, 50);
PDF.DrawLineTo(130, 50);
PDF.Stroke;

PDF.SetLineCapStyle(lcsProjectingSquare);
PDF.MoveTo(30, 70);
PDF.DrawLineTo(130, 70);
PDF.Stroke;

PDF.SaveToFile('test.pdf', true);
C/C++
[copy to clipboard]
// PDF object is supposed to be created
PDF->SetLineWidth(10);

PDF->SetLineCapStyle(lcsButtEnd);
PDF->MoveTo(30, 30);
PDF->DrawLineTo(130, 30);
PDF->Stroke();

PDF->SetLineCapStyle(lcsRound);
PDF->MoveTo(30, 50);
PDF->DrawLineTo(130, 50);
PDF->Stroke();

PDF->SetLineCapStyle(lcsProjectingSquare);
PDF->MoveTo(30, 70);
PDF->DrawLineTo(130, 70);
PDF->Stroke();

PDF->SaveToFile("test.pdf", true);
C#
[copy to clipboard]
// PDF object is supposed to be created
PDF.SetLineWidth(10);

PDF.SetLineCapStyle(LineCapStyle.lcsButtEnd);
PDF.MoveTo(30, 30);
PDF.DrawLineTo(130, 30);
PDF.Stroke();

PDF.SetLineCapStyle(LineCapStyle.lcsRound);
PDF.MoveTo(30, 50);
PDF.DrawLineTo(130, 50);
PDF.Stroke();

PDF.SetLineCapStyle(LineCapStyle.lcsProjectingSquare);
PDF.MoveTo(30, 70);
PDF.DrawLineTo(130, 70);
PDF.Stroke();

PDF.SaveToFile("test.pdf", true);
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
PDF.SetLineWidth 10

PDF.SetLineCapStyle 0 'LineCapStyle.lcsButtEnd = 0
PDF.MoveTo 30, 30
PDF.DrawLineTo 130, 30
PDF.Stroke

PDF.SetLineCapStyle 1 'LineCapStyle.lcsRound = 1
PDF.MoveTo 30, 50
PDF.DrawLineTo 130, 50
PDF.Stroke

PDF.SetLineCapStyle 2 'LineCapStyle.lcsProjectingSquare = 2
PDF.MoveTo 30, 70
PDF.DrawLineTo 130, 70
PDF.Stroke

PDF.SaveToFile "test.pdf", true

See Also

Reference