Uses direct2d, d2d1; Procedure outputs (Sender: tobject); var CVS: tdirect2dcanvas; ilayer: id2d1layer; rlayerparameters: parameters; WIC: twicimage; R: trect; iellipse: temperature; begin WIC: = twicimage. create; WIC. loadfromfile ('C: \ temp \ test.png '); R: = rect (0, 0, WIC. width, WIC. height); {ry} d2dfactory. createellipsegeometry (d2d1ellipse (d2d1pointf (WIC. width/2, WIC. heweigh T/2), WIC. width/2, WIC. height/2), iellipse); CVS: = tdirect2dcanvas. create (canvas, clientrect); CVs. rendertarget. settransform (td2dmatrix3x2f. translation (ClientWidth-wic.width)/2, (ClientHeight-wic.height)/2); CVs. begindraw; CVs. rendertarget. createlayer (nil, ilayer); rlayerparameters. contentbounds: = r; rlayerparameters. geometricmask: = iellipse ;//! Rlayerparameters. maskantialiasmode: = d2d1_antialias_mode_per_primitive; rlayerparameters. masktransform: = td2dmatrix3x2f. identity; rlayerparameters. opacity: = 1.0; // rlayerparameters. opacitybrush: = nil; rlayerparameters. layeroptions: = d2d1_layer_options_none; CVs. rendertarget. pushlayer (rlayerparameters, ilayer); CVs. stretchdraw (R, WIC); CVs. rendertarget. poplayer; CVs. enddraw; CVs. free; WIC. free; end; Procedure tform1.formresize (Sender: tobject); begin repaint; end;
: