Let's take a look at it first:
Code:
Private void button#click (Object sender, system. eventargs E)
{
Graphics G = This. creategraphics ();
G. Clear (color. White );
// G. interpolationmode = interpolationmode. highqualitybicubic;
G. compositingquality = compositingquality. highquality;
G. smoothingmode = smoothingmode. highquality;
Int radius = 200;
Circulartextuallayout CTL = new circulartextuallayout ();
CTL. radius = radius;
Point Location = new point (50, 20 );
// CTL. centerpoint = new point (location. x + radius, location. Y + radius );
CTL. textdrawing = "正 ";
Float arcangle = 270;
CTL. arcangle = arcangle;
CTL. anglestart =-arcangle/2 + arcangle/2/CTL. textdrawing. length;
CTL. textfontinner = new font (" 正 ", radius/3.2f );
CTL. ratiox = 0.6f;
CTL. borderwidth = (INT) (CTL. radius/40 );
// CTL. isbold = false;
CTL. Location = location;
CTL. wordscolor = color. fromargb (250, color. Red );
CTL. bordercolor = color. fromargb (250, color. Red );
CTL. rectcolor = color. fromargb (250, color. Red );
CTL. Draw (g );
G. Dispose ();
}
Watermark image in the official seal style ():
Private void button2_click (Object sender, system. eventargs E)
{
Graphics G = This. creategraphics ();
G. Clear (color. White );
// G. drawimage (image. fromfile (@ "F:/IMGs/girl/227.jpg"), 0, 0 );
G. drawimage (image. fromfile (@ "D:/johnsuntest/AA/05290_b11.jpg"), 0, 0 );
// G. interpolationmode = interpolationmode. highqualitybicubic;
G. compositingquality = compositingquality. highquality;
G. smoothingmode = smoothingmode. highquality;
Int radius = 100;
Int offset = 1;
Circulartextuallayout CTL = new circulartextuallayout ();
CTL. radius = radius;
Point Location = new point (500,100 );
// CTL. centerpoint = new point (location. x + radius, location. Y + radius );
CTL. textdrawing = "watermark image creation in the seal style ";
Float arcangle = 270;
// CTL. anglestart =-105 + 210/CTL. textdrawing. Length/2;
CTL. arcangle = arcangle;
// CTL. anglestart = (arcangle/2) * (-1 + 1/CTL. textdrawing. Length );
CTL. anglestart =-arcangle/2 + arcangle/2/CTL. textdrawing. length;
// CTL. textfontinner = new font (" 正 ", 56f );
CTL. textfontinner = new font (" 正 ", radius/3.2f );
CTL. ratiox = 0.6f;
CTL. borderwidth = (INT) (CTL. radius/40 );
// CTL. isbold = false;
CTL. Location = location;
CTL. wordscolor = color. fromargb (160, color. Black );
CTL. bordercolor = color. fromargb (160, color. Black );
CTL. rectcolor = color. fromargb (160, color. Black );
CTL. Draw (g );
Location. offset (-offset * 2,-offset * 2 );
CTL. Location = location;
CTL. wordscolor = color. fromargb (160, color. White );
CTL. bordercolor = color. fromargb (60, color. White );
CTL. rectcolor = color. fromargb (160, color. White );
CTL. Draw (g );
G. Dispose ();
}
Related links:
Use C # To create a seal (continued) http://blog.csdn.net/johnsuna/archive/2006/03/23/635989.aspx
Create a circular seal http://blog.csdn.net/johnsuna/archive/2007/10/12/1821531.aspx in WPF
Later WPF versions:
Article 2Http://blog.csdn.net/johnsuna/archive/2008/04/28/2336495.aspx)