In the following process, we can draw a translucent line on the screen. How can we change this line on the canvas of the image? Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiMultimedia/html/delphi_20060929140743277.html
Procedure tform1.button1click (Sender: tobject );
VaR
Hpen: thandle;
HDC: thandle;
Begin
Hpen: = createpen (ps_solid, 100, clred );
HDC: = getdc (0 );
Setrop2 (HDC, r2_maskpen );
SelectObject (HDC, Hpen );
Lineto (HDC, 400,400 );
End;
I tried it multiple times. After HDC: = image1.canvas. Handle;, I can draw a line directly on the image canvas. But it cannot achieve a translucent effect. How can I solve it?
For more information, see.
Canvas. Pen. Mode: = pmmask; set the paint brush to meet the general requirements,
Some XOR is too powerful, so that the color is not very correct, if you want to be very correct, you must take two images for Calculation