代码说明:
This is an experimental component which encapsulates a windows region. The specific aim is to avoid using the API calls, but use a TRegion instead. The direct parallel is the use of a TCanvas rather than the API drawing calls. Regions can be used to clip the drawing to a form so that only drawing in prescribed regions can occur and also used to clip the form so that form can take on shapes other than rectangular. It is the latter behaviour that this component currently provides. Regions can be rectangular, elliptical, polygons and text. You can test to see if given points are inside a region, fill a region with a brush and frame a region with a brush. Regions when defined can be saved to disc and reloaded (which gives the possibility of defining the region and using the region in separate programs). Regions can be moved and scaled, and also with NT4 rotated and skewed. To obtain some of the features (such as text) I have encapsulated the drawing path API calls in another class, called suprisingly TPath. Many other shapes are possible by first using a path to create a region. Other shapes include bezier curves and areas drawn by lines (as against a polyline or polygon), and also with NT4, arcs, chords and pies (and more). I am releasing this beta version for trial and comment. I have no specific requirements of any one picking up and using this component, but I really would *appreciate* feedback. By Grahame Marsh (mailto:GSMarsh@aol.com)
封装一个窗体区间的实验性组件,不使用API
【立即下载】
|