In this example:
Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs; Type tform1 = Class (tform) Procedure formpaint (Sender: tobject); end; vaR form1: tform1; implementation {$ R *. DFM} procedure tform1.formpaint (Sender: tobject); const n = 50; var RGN: hrgn; X1, Y1, X2, Y2: integer; begin X1: = N; Y1: = N Div 2; X2: = clientwidth-N; Y2: = clientheight-N; {create an elliptical region} // RGN: = createellipticrgn (x1, Y1, X2, Y2 ); RGN: = createellipticrgnindirect (rect (x1, Y1, X2, Y2); {the same row serves different functions} {fill area} canvas. brush. color: = clsilver; canvas. brush. style: = bscross; fillrgn (canvas. handle, RGN, canvas. brush. handle); {draw area boundary} canvas. brush. color: = clred; canvas. brush. style: = bssolid; framergn (canvas. handle, RGN, canvas. brush. handle, 2, 2); deleteobject (RGN); end.