dc: hdc;
begin
if (visible or (csdesigning in componentstate) and not (
csnodesignvisible in controlstyle)) and (parent <> nil) and
parent.handleallocated then
if csopaque in controlstyle then
begin
//直接调用user32.dll的getdc
dc := getdc(parent.handle);
try
//直接调用gdi32.dll的intersectcliprect
intersectcliprect(dc, left, top, left + width, top +
height);
// parent.paintcontrols调用大量的api
parent.paintcontrols(dc, self);
finally