biWidth = info.Size.Width;
biHeight = info.Size.Height;
biPlanes = 1;
- biBitCount = (short)System.Drawing.Image.GetPixelFormatSize(info.Format);
+ biBitCount = (short)System.Drawing.Image.GetPixelFormatSize(info.PixelFormat);
biCompression = (int)BitmapCompression.BI_RGB;
biSizeImage = (int)info.RawImageBytes.Length;
biXPelsPerMeter = 0;
switch (bmih.biBitCount) {
case 24:
- info.Format = PixelFormat.Format24bppRgb;
+ info.PixelFormat = PixelFormat.Format24bppRgb;
if (bmfh.bfOffBits != 0L) stream.Seek (startPosition + bmfh.bfOffBits,SeekOrigin.Begin);
if (bmih.biCompression == (uint)BitmapCompression.BI_RGB) {
info.RawImageBytes = new byte[bmih.biSizeImage];
}
break;
case 32:
- info.Format = PixelFormat.Format32bppArgb;
+ info.PixelFormat = PixelFormat.Format32bppArgb;
if (bmfh.bfOffBits != 0L) stream.Seek (startPosition + bmfh.bfOffBits,SeekOrigin.Begin);
if (bmih.biCompression == (uint)BitmapCompression.BI_RGB) {
info.RawImageBytes = new byte[bmih.biSizeImage];
+2003-07-23 Alexandre Pigolkine
+ * JPEGCodec.cs
+ * PNGCodec.cs
+ * BmpCodec.cs cosmetic changes
+
2003-07-22 Alexandre Pigolkine
* ImageCodecInfo.cs
* ImageFormat.cs
if (cinfo.OutColorSpace == J_COLOR_SPACE.JCS_RGB) {
if (cinfo.QuantizeColors) {
- info.Format = PixelFormat.Format8bppIndexed;
+ info.PixelFormat = PixelFormat.Format8bppIndexed;
}
else {
- info.Format = PixelFormat.Format24bppRgb;
+ info.PixelFormat = PixelFormat.Format24bppRgb;
}
}
else {
- info.Format = PixelFormat.Format8bppIndexed;
+ info.PixelFormat = PixelFormat.Format8bppIndexed;
}
info.Size = new Size(cinfo.OutputWidth,cinfo.OutputHeight);
info.Stride = row_width;
info.Palette = new ColorPalette(1, cinfo.ColorMap);
- info.Format = PixelFormat.Format24bppRgb;
+ info.PixelFormat = PixelFormat.Format24bppRgb;
info.RawImageBytes = new byte[(cinfo.OutputHeight) * row_width];
JSAMPARRAY outbuf = new JSAMPARRAY(cinfo.Stride);
internal unsafe bool Encode( Stream stream, InternalImageInfo info) {
- int bpp = Image.GetPixelFormatSize(info.Format) / 8;
+ int bpp = Image.GetPixelFormatSize(info.PixelFormat) / 8;
if( bpp != 3 && bpp != 4) {
- throw new ArgumentException(String.Format("Supplied pixel format is not yet supported: {0}, {1} bpp", info.Format, Image.GetPixelFormatSize(info.Format)));
+ throw new ArgumentException(String.Format("Supplied pixel format is not yet supported: {0}, {1} bpp", info.PixelFormat, Image.GetPixelFormatSize(info.PixelFormat)));
}
fs = stream;
// FIXME: do a real palette processing
//info.Palette = new ColorPalette(1, cinfo.ColorMap);
// FIXME: get color information from png info structure
- info.Format = PixelFormat.Format24bppRgb;
+ info.PixelFormat = PixelFormat.Format24bppRgb;
info.RawImageBytes = new byte[height * row_width];
IntPtr row_data = Marshal.AllocHGlobal (row_width);
internal unsafe bool Encode( Stream stream, InternalImageInfo info)
{
- int bpp = Image.GetPixelFormatSize(info.Format) / 8;
+ int bpp = Image.GetPixelFormatSize(info.PixelFormat) / 8;
if( bpp != 3 && bpp != 4) {
- throw new ArgumentException(String.Format("Supplied pixel format is not yet supported: {0}, {1} bpp", info.Format, Image.GetPixelFormatSize(info.Format)));
+ throw new ArgumentException(String.Format("Supplied pixel format is not yet supported: {0}, {1} bpp", info.PixelFormat, Image.GetPixelFormatSize(info.PixelFormat)));
}
fs = stream;
void InitFromStream( Stream stream) {
InternalImageInfo info = System.Drawing.Image.Decode(stream);
if (info != null) {
- createdFrom_ = info;
+ sourceImageInfo = info;
IntPtr memDC = Win32.CreateCompatibleDC(IntPtr.Zero);
IntPtr dibBits;
BITMAPINFO_FLAT bmi = new BITMAPINFO_FLAT();
bmi.bmiHeader_biWidth = info.Size.Width;
bmi.bmiHeader_biHeight = info.Size.Height;
bmi.bmiHeader_biPlanes = 1;
- bmi.bmiHeader_biBitCount = (short)System.Drawing.Image.GetPixelFormatSize(info.Format);
+ bmi.bmiHeader_biBitCount = (short)System.Drawing.Image.GetPixelFormatSize(info.PixelFormat);
bmi.bmiHeader_biCompression = (int)BitmapCompression.BI_RGB;
bmi.bmiHeader_biSizeImage = (int)info.RawImageBytes.Length;
bmi.bmiHeader_biXPelsPerMeter = 0;
Win32.DeleteDC(memDC);
imageSize_ = info.Size;
imageFormat_ = info.RawFormat;
- pixelFormat_ = info.Format;
+ pixelFormat_ = info.PixelFormat;
}
}
+2003-07-30 Alexandre Pigolkine
+ * Bitmap.cs
+ * Image.cs cosmetic changes
+
2003-06-29 Alexandre Pigolkine
* Graphics.cs image drawing
throw new NotImplementedException ();
}
- protected InternalImageInfo createdFrom_ = null;
+ protected InternalImageInfo sourceImageInfo = null;
public InternalImageInfo ConvertToInternalImageInfo() {
InternalImageInfo result = new InternalImageInfo();
IntPtr hTempBitmap = IntPtr.Zero;
IntPtr hdc = IntPtr.Zero;
result.Size = imageSize_;
- result.Format = pixelFormat_;
+ result.PixelFormat = pixelFormat_;
//result.Stride =
if(selectedIntoGraphics_ != null) {
hdc = selectedIntoGraphics_.GetHdc();