using System;
using System.Collections.Generic;
using System.Drawing;
using GeoSigmaDrawLib;
namespace GeoSigma.SigmaDrawerStyle
{
///
/// 曲线样式管理类,说是管理,其实目前仅处理获取
///
public class WellCurveStyleManager
{
private static readonly Lazy LazyInstance =
new Lazy(() => new WellCurveStyleManager());
///
/// 单例
///
public static WellCurveStyleManager Instance => LazyInstance.Value;
private WellCurveStyleManager()
{
}
public string[] GetNames()
{
if (!GeoSigmaWellPoleXY.GetCurveFillSymbolNames(out string[] names))
{
return names;
}
return new string[] { };
}
///
/// 获取曲线样式
///
/// 曲线样式名称
/// width
/// height
/// 曲线样式
public Bitmap DrawStyle(string name, int width, int height)
{
var bitmap = new Bitmap(width, height);
Graphics graphics = Graphics.FromImage(bitmap);
IntPtr hdc = graphics.GetHdc();
if (GeoSigmaWellPoleXY.GetDrawCurveFillSymbol(name, hdc, width, height))
{
return bitmap;
}
graphics.ReleaseHdc();
return null;
}
}
}