[GDI+] 创建Images的两种方式
使用Bitmap构造完成一个新的image对象,大小为xsize,ysize
[C#]
Bitmap myImage = new Bitmap(<xsize>,<ysize>);
[VB]
Dim MyImage As new Bitmap(<xsize>,<ysize>)
![](/Images/OutliningIndicators/None.gif)
下面这个方法创建一个默认颜色深度的Images对象,也可以使用像素格式化的参数构造
[C#]
![](/Images/OutliningIndicators/None.gif)
Bitmap myImage = new Bitmap(<xsize>,<ysize>,PixelFormat.<format>);
![](/Images/OutliningIndicators/None.gif)
[VB]
![](/Images/OutliningIndicators/None.gif)
Dim MyImage As new Bitmap(<xsize>,<ysize>,PixelFormat.<format>)
![](/Images/OutliningIndicators/None.gif)
[C#]
![](/Images/OutliningIndicators/None.gif)
Bitmap bm = (Bitmap)Image.FromFile("<filename>");
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
[VB]
![](/Images/OutliningIndicators/None.gif)
Dim bm as Bitmap = CType(Image.FromFile("<filename">),Bitmap)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
下面这个方法创建一个默认颜色深度的Images对象,也可以使用像素格式化的参数构造
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
Pixel Formats valid for the creation of a bitmap image are:
Format16bppArgb1555
Format16bppGrayScale
Format16bppRgb555
Format16bppRgb565
Format1bppIndexed
Format24bppRgb
Format32bppArgb
Format32bppPArgb
Format32bppRgb
Format48bppRgb
Format4bppIndexed
Format64bppArgb
Format64bppPArgb
Format8bppIndexed
Images 可以从磁盘装在标准格式的位图文件(JPEG, GIF, TIFF or windows Bitmap)
可以使用方法 Image.FromFile 装载指定的 Image 文件
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
[待续...]
http://www.donghaisoft.com
易学之家,八字,六爻,风水,奇门遁甲,六壬,金口诀,周易,阳宅风水,风水堪舆,张锋,风水罗盘指南针