⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pathgradientbrush.aspx

📁 asp.net技术内幕的书配源码
💻 ASPX
字号:
<%@ Page ContentType="image/gif" Language="C#" %>
<%@ Import namespace="System.Drawing" %>
<%@ Import namespace="System.Drawing.Imaging" %>
<%@ Import namespace="System.Drawing.Drawing2D" %>

<script language="C#" runat=server>

void Page_Load(Object sender , EventArgs e) 
{
	Bitmap objBitmap;
	Graphics objGraphics;
	GraphicsPath objPath;
	PathGradientBrush objBrush;
	    
	//Create Bitmap
	objBitmap = new Bitmap( 400, 400 );

	//Create Graphics
	objGraphics = Graphics.FromImage( objBitmap );

	//Create Path
	objPath = new GraphicsPath( );
	objPath.AddLine( 10, 10, 300, 10 );
	objPath.AddEllipse( 50, 50, 300, 300 );
	objPath.AddEllipse( 10, 10, 200, 200 );
	objPath.AddLine( 10, 300, 100, 300 );

	//Create PathGradient Brush
	objBrush = new PathGradientBrush( objPath );
	objBrush.CenterColor = Color.Red;

	//Draw Path
	objGraphics.FillPath( objBrush, objPath );

	//Display Bitmap
	objBitmap.Save( Response.OutputStream, ImageFormat.Gif );
}

</Script>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -