核心代码:
/// <summary>
/// 创建立体感的饼状图
/// </summary>
/// <param name="angles">扇区角度List集合</param>
/// <param name="lightColors">扇区上面亮度List集合</param>
/// <param name="darkColors">扇区下面暗度List集合</param>
/// <returns></returns>
public static Texture2D PieChart3d(ref Texture2D lp, List<float> angles,List<System.Drawing.Color> lightColors,List<System.Drawing.Color> darkColors,System.Drawing.Color light,System.Drawing.Color dark)
{
if (lp == null)
{
lp = new Texture2D(512, 512);
}
Bitmap bitmap = new Bitmap(512, 512);
System.Drawing.Graphics ccd = System.Drawing.Graphics.FromImage(bitmap);
ccd.SmoothingMode = SmoothingMode.AntiAlias;
ccd.Clear(System.Drawing.Color.Transparent);
IntPtr ccdhdc = ccd.GetHdc(); //获取设备
int vOffset = 30;
int left

本文介绍如何利用C#的System.Drawing库创建立体饼状图,详细阐述了绘制3D饼状图的核心代码实现,适合C#开发者学习图形绘制技巧。
最低0.47元/天 解锁文章
766

被折叠的 条评论
为什么被折叠?



