共用方式為


.NET 範例 - Windows Form:GDI+

這個章節包括下列範例:

文字範例

筆刷範例

畫筆範例

影像範例

文字範例

這個範例示範繪製文字時,GDI+ 中的 TrueType 字型的建立和使用。

連結到線上範例文件

連結到線上範例原始程式碼

這個範例中所用的命名空間:

System;System.Drawing;System.ComponentModel;System.Windows.Forms;System.IO;System.Drawing.Text;System.Drawing.Drawing2D;System.Reflection

這個範例中所用的類別:

Font;Brush;String;SolidBrush;FontFamily;Graphics;Form;Image;TextureBrush;Component;Assembly;Style;StringFormat;Bitmap;Stream;Container;Control;Message;LinearGradientBrush;Thread;Application;MessageBox;PaintEventArgs;Exception;Icon;EventArgs

筆刷範例

這個範例示範 GDI+ 筆刷的建立和使用,以填滿各種 GDI+ 形狀。

連結到線上範例文件

連結到線上範例原始程式碼

這個範例中所用的命名空間:

System;System.Drawing;System.Windows.Forms;System.ComponentModel;System.IO;System.Drawing.Drawing2D;System.Reflection

這個範例中所用的類別:

Brush;Path;Form;Type;Graphics;SolidBrush;Brushes;Component;Style;Image;LinearGradientBrush;Container;HatchBrush;GraphicsPath;Assembly;PathGradientBrush;PaintEventArgs;Stream;Thread;Bitmap;Control;TextureBrush;Application;EventArgs

畫筆範例

這個範例示範 GDI+ 畫筆的建立和使用,以繪製各種線條和曲線。

連結到線上範例文件

連結到線上範例原始程式碼

這個範例中所用的命名空間:

System;System.Drawing;System.Windows.Forms;System.ComponentModel;System.IO;System.Drawing.Drawing2D;System.Reflection

這個範例中所用的類別:

Brush;Pen;Image;Style;Form;TextureBrush;Component;Pens;Assembly;Graphics;Stream;Container;Bitmap;EventArgs;Thread;Icon;SolidBrush;PaintEventArgs;Control;Application

影像範例

這個範例示範使用 GDI+ 來建立和使用影像。範例會顯示如何從磁碟或 Web 載入影像,以及如何將產生的影像內容存入磁碟。

連結到線上範例文件

連結到線上範例原始程式碼

這個範例中所用的命名空間:

System;System.Drawing;System.Windows.Forms;System.ComponentModel;System.Reflection;System.IO;System.Drawing.Text;System.Drawing.Imaging;System.Drawing.Drawing2D;System.Net

這個範例中所用的類別:

Image;Bitmap;Form;Font;Brush;Graphics;FontFamily;Stream;Component;Style;SolidBrush;Message;WebRequest;Pen;Container;MessageBox;Assembly;EventArgs;Button;Control;MemoryStream;Cache;TextureBrush;Exception;Application;CredentialCache;Trace;Thread;StackTrace;Stack;EventHandler;PaintEventArgs;String;ImageFormat