JCL Help:ClipLine@Float@Float@Float@Float@Float@Float@Float@Float@PClipCodes

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Intersects a line with a rectangle.


Pascal

 function ClipLine(var X1: Integer; var Y1: Integer; var X2: Integer; var Y2: Integer; const ClipRect: TRect): Boolean; overload;
function ClipLine(var X1: Float; var Y1: Float; var X2: Float; var Y2: Float; const MinX: Float; const MinY: Float; const MaxX: Float; const MaxY: Float; Codes: PClipCodes = nil): Boolean; overload;


Parameters

Parameters Description
var X1: Integer Horizontal coordinate of the line's starting point.
var Y1: Integer Vertical coordinate of the line's starting point.
var X2: Integer Horizontal coordinate of the line's ending point.
var Y2: Integer Vertical coordinate of the line's ending point.
const ClipRect: TRect Clipping rectangle.
const MinX: Float Left border of the clipping rectangle.
const MinY: Float Top border of the clipping rectangle.
const MaxX: Float Right border of the clipping rectangle.
const MaxY: Float Bottom border of the clipping rectangle.
Codes: PClipCodes = nil Points to a TClipCodes variable in which the clipping code for (X2, Y2) is stored. As for the use of this parameter, have a look at the source code of the DrawPolyLine routine.


Return Value

True, if some section of the line lies inside of the clipping rectangle (and eventually shall be drawn), False otherwise.


Description

Computes the section of a line that lies inside a given rectangle.


About

Unit

JclGraphUtils


Donator

Robert Rossmair


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page