WorldWind源码剖析系列:图像助手类ImageHelper
2015-06-04 00:26
357 查看
图像助手类ImageHelper封装了对各种图像的操作。该类类图如下。
提供的主要处理方法基本上都是静态函数,简要描述如下:
public static bool IsGdiSupportedImageFormat(string imageFileName) 静态函数用给定的图像文件名称来判断该图像是否是Windows GDI+支持的图像。
public static Texture LoadTexture(string textureFileName) 静态函数从指定的图像文件路径加载并返回纹理对象,依次调用其另外3中重载形式。
public static void CreateAlphaPngFromBrightness(string srcFilePath, string destinationPngFilePath) 静态函数用来从明度创建Alpha通道的Png图像(待确认)。
public static Image LoadImage(string bitmapFileName) 静态函数用来从指定的文件路径加载图像。内部调用System.Drawing.Image.FromFile(bitmapFileName)函数。
public static Cursor LoadCursor(string relativePath) 静态函数用来从指定的光标文件路径加载自定义光标。内部调用System.Windows.Form.Cursor类的构造函数。
public static Texture LoadIconTexture(string relativePath) 静态函数从指定路径加载Icon图像并返回纹理对象。内部调用Microsoft.DirectX.Direct3D.TextureLoader.FromFile()函数。
private static Bitmap CreateDefaultImage()静态函数功能是:当请求的Bitmap图像不可用时创建默认的图像来使用。
public static string FindResource(string relativePath)静态函数根据给定的相对路径名判断文件资源是否存在,如存在则返回全路径名。
public static void ConvertToDxt1(string originalImagePath, string outputDdsPath, bool eraseOriginal) 静态函数将GDI+可读取的任意类型图像传唤成DXT1级DDS纹理文件。
public static void ConvertToDxt1(Stream originalImageStream, string outputDdsPath)
public static void ConvertToDxt3(string originalImagePath, string outputDdsPath, bool eraseOriginal)
public static void ConvertToDxt3(Stream originalImageStream, string outputDdsPath)
public static void ConvertToDds(string originalImagePath, string outputDdsPath, Format format, bool eraseOriginal)
这四个静态函数功能基本和上面的静态函数一样,这里就不详细介绍了。
提供的主要处理方法基本上都是静态函数,简要描述如下:
public static bool IsGdiSupportedImageFormat(string imageFileName) 静态函数用给定的图像文件名称来判断该图像是否是Windows GDI+支持的图像。
public static Texture LoadTexture(string textureFileName) 静态函数从指定的图像文件路径加载并返回纹理对象,依次调用其另外3中重载形式。
public static void CreateAlphaPngFromBrightness(string srcFilePath, string destinationPngFilePath) 静态函数用来从明度创建Alpha通道的Png图像(待确认)。
public static Image LoadImage(string bitmapFileName) 静态函数用来从指定的文件路径加载图像。内部调用System.Drawing.Image.FromFile(bitmapFileName)函数。
public static Cursor LoadCursor(string relativePath) 静态函数用来从指定的光标文件路径加载自定义光标。内部调用System.Windows.Form.Cursor类的构造函数。
public static Texture LoadIconTexture(string relativePath) 静态函数从指定路径加载Icon图像并返回纹理对象。内部调用Microsoft.DirectX.Direct3D.TextureLoader.FromFile()函数。
private static Bitmap CreateDefaultImage()静态函数功能是:当请求的Bitmap图像不可用时创建默认的图像来使用。
public static string FindResource(string relativePath)静态函数根据给定的相对路径名判断文件资源是否存在,如存在则返回全路径名。
public static void ConvertToDxt1(string originalImagePath, string outputDdsPath, bool eraseOriginal) 静态函数将GDI+可读取的任意类型图像传唤成DXT1级DDS纹理文件。
public static void ConvertToDxt1(Stream originalImageStream, string outputDdsPath)
public static void ConvertToDxt3(string originalImagePath, string outputDdsPath, bool eraseOriginal)
public static void ConvertToDxt3(Stream originalImageStream, string outputDdsPath)
public static void ConvertToDds(string originalImagePath, string outputDdsPath, Format format, bool eraseOriginal)
这四个静态函数功能基本和上面的静态函数一样,这里就不详细介绍了。
相关文章推荐
- 【HDU】5254 棋盘占领(BFS)
- WorldWind源码剖析系列:缓冲类Cache
- C/C++语言统计文件中单词出现个数
- vmware里面的linux怎么和windows相互传文件
- 正规表示法与文件格式化处理
- Oracle之SQL基础
- WorldWind源码剖析系列:绘制参数类DrawArgs
- 广商博客冲刺第六七天new
- 4.20
- [hdu4498]离散化,simpson求积分
- java简单的判断奇偶数方法(i & 1) != 0 i为奇数
- 团队管理的感悟---尽可能不要让成员感到怀才不遇
- List subList()
- hdu 1016 Prime Ring Problem(素数环,超时)
- 西普学院Crypto之用户名和密码
- 广商博客冲刺第四五天new
- WorldWind源码剖析系列:设置类SettingsBase
- Codeforces Round #249 (Div. 2) B. Pasha Maximizes(模拟)
- qemu-kvm编译错误
- [RHEL7.1]重新封装系统(制作模板)