JCL Help:Line Patterns

From Project JEDI Wiki
Jump to navigationJump to search


Summary

The summary for this help topic does not exist, edit this page


Description

JclGraphics defines several functions to support non-uniform lines. This includes gradient lines, dashed lines etc.
The idea is pretty simple: TJclBitmap32 holds a dynamic array of colors, and a counter, which 'crawls' along the array and reads colors from its position. The line drawing algorithm queries color value from the current counter position at each point, then the counter is automatically incremented to get ready to supply the next value to line rasterisation routine.
The counter, accessed through the StippleCounter property, wraps itself automatically at the edges of color array. It can move in both directions depending on stipple step, which in turn can be positive or negative. Its malue may even be fractional in this case resulting color is interpolated. The step is accessed with StippleStep property.
GetStippleColor returns color from the current counter position and automatically increments counter position by the counter step, so that next GetStippleColor call will return color value from the next position.
Drawing functions that support line patterns have 'P' in their postfix (as in LineFSP).
Warning: the counter is not thread-aware, it is shared by all threads accessing the bitmap. Additional care should be taken when multiple threads draw stippled lines in the same bitmap.


See Also

Graphics_Naming_Conventions TJclBitmap32 TJclBitmap32.GetStippleColor TJclBitmap32.StippleCounter TJclBitmap32.StippleStep


About

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