[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnetlib/System.Drawing Bitmap.cs, 1.2, 1.3 Im
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnetlib/System.Drawing Bitmap.cs, 1.2, 1.3 Image.cs, 1.2, 1.3 System.Drawing.build, 1.3, 1.4 |
Date: |
Wed, 09 Jul 2003 21:42:25 -0400 |
Update of /cvsroot/dotgnu-pnet/pnetlib/System.Drawing
In directory subversions:/tmp/cvs-serv6379/System.Drawing
Modified Files:
Bitmap.cs Image.cs System.Drawing.build
Log Message:
Begin integrating "DotGNU.Images" into the "System.Drawing" library.
Index: Bitmap.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Drawing/Bitmap.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** Bitmap.cs 9 Jun 2003 22:15:09 -0000 1.2
--- Bitmap.cs 10 Jul 2003 01:42:21 -0000 1.3
***************
*** 28,31 ****
--- 28,32 ----
using System.Drawing.Design;
using System.ComponentModel;
+ using DotGNU.Images;
#if !ECMA_COMPAT
***************
*** 37,41 ****
typeof(UITypeEditor))]
#endif
! public sealed class Bitmap : Image
{
// Constructors.
--- 38,42 ----
typeof(UITypeEditor))]
#endif
! public sealed class Bitmap : System.Drawing.Image
{
// Constructors.
***************
*** 65,69 ****
: this(width, height, PixelFormat.Format32bppArgb) {}
[TODO]
! public Bitmap(int width, int height, PixelFormat format)
{
// TODO
--- 66,71 ----
: this(width, height, PixelFormat.Format32bppArgb) {}
[TODO]
! public Bitmap(int width, int height,
! System.Drawing.Imaging.PixelFormat format)
{
// TODO
***************
*** 86,93 ****
[TODO]
public Bitmap(int width, int height, int stride,
! PixelFormat format, IntPtr scan0)
{
// TODO
}
#if CONFIG_SERIALIZATION
internal Bitmap(SerializationInfo info, StreamingContext context)
--- 88,96 ----
[TODO]
public Bitmap(int width, int height, int stride,
! System.Drawing.Imaging.PixelFormat format,
IntPtr scan0)
{
// TODO
}
+ internal Bitmap(DotGNU.Images.Image image) : base(image) {}
#if CONFIG_SERIALIZATION
internal Bitmap(SerializationInfo info, StreamingContext context)
***************
*** 97,101 ****
// Clone this bitmap and transform it into a new pixel format
[TODO]
! public Bitmap Clone(Rectangle rect, PixelFormat format)
{
// TODO
--- 100,105 ----
// Clone this bitmap and transform it into a new pixel format
[TODO]
! public Bitmap Clone
! (Rectangle rect,
System.Drawing.Imaging.PixelFormat format)
{
// TODO
***************
*** 103,107 ****
}
[TODO]
! public Bitmap Clone(RectangleF rect, PixelFormat format)
{
// TODO
--- 107,112 ----
}
[TODO]
! public Bitmap Clone
! (RectangleF rect,
System.Drawing.Imaging.PixelFormat format)
{
// TODO
***************
*** 165,169 ****
[TODO]
public BitmapData LockBits(Rectangle rect, ImageLockMode flags,
! PixelFormat format)
{
// TODO
--- 170,174 ----
[TODO]
public BitmapData LockBits(Rectangle rect, ImageLockMode flags,
!
System.Drawing.Imaging.PixelFormat format)
{
// TODO
Index: Image.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Drawing/Image.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** Image.cs 9 Jun 2003 22:15:09 -0000 1.2
--- Image.cs 10 Jul 2003 01:42:21 -0000 1.3
***************
*** 26,29 ****
--- 26,30 ----
using System.Runtime.Serialization;
using System.Drawing.Imaging;
+ using DotGNU.Images;
#if !ECMA_COMPAT
***************
*** 46,54 ****
internal float horizontalResolution;
internal ColorPalette palette;
! internal PixelFormat pixelFormat;
internal int[] propertyIdList;
internal PropertyItem[] propertyItems;
internal float verticalResolution;
internal int width;
// Constructors.
--- 47,56 ----
internal float horizontalResolution;
internal ColorPalette palette;
! internal System.Drawing.Imaging.PixelFormat pixelFormat;
internal int[] propertyIdList;
internal PropertyItem[] propertyItems;
internal float verticalResolution;
internal int width;
+ internal DotGNU.Images.Image dgImage;
// Constructors.
***************
*** 58,61 ****
--- 60,90 ----
// TODO
}
+ internal Image(DotGNU.Images.Image dgImage)
+ {
+ flags = 0;
+ #if !ECMA_COMPAT
+ switch(dgImage.LoadFormat)
+ {
+ case DotGNU.Images.Image.Png:
+ rawFormat = ImageFormat.Png;
break;
+ case DotGNU.Images.Image.Jpeg:
+ rawFormat = ImageFormat.Jpeg;
break;
+ case DotGNU.Images.Image.Gif:
+ rawFormat = ImageFormat.Gif;
break;
+ case DotGNU.Images.Image.Tiff:
+ rawFormat = ImageFormat.Tiff;
break;
+ case DotGNU.Images.Image.Bmp:
+ rawFormat = ImageFormat.Bmp;
break;
+ case DotGNU.Images.Image.Icon:
+ rawFormat = ImageFormat.Icon;
break;
+ }
+ #endif
+ width = dgImage.Width;
+ height = dgImage.Height;
+ horizontalResolution =
Graphics.DefaultScreenDpi;
+ verticalResolution = Graphics.DefaultScreenDpi;
+ pixelFormat =
(System.Drawing.Imaging.PixelFormat)
+ (dgImage.PixelFormat);
+ }
#if CONFIG_SERIALIZATION
[TODO]
***************
*** 121,125 ****
}
}
! public PixelFormat PixelFormat
{
get
--- 150,154 ----
}
}
! public System.Drawing.Imaging.PixelFormat PixelFormat
{
get
***************
*** 196,200 ****
protected virtual void Dispose(bool disposing)
{
! // TODO
}
--- 225,233 ----
protected virtual void Dispose(bool disposing)
{
! if(dgImage != null)
! {
! dgImage.Dispose();
! dgImage = null;
! }
}
***************
*** 204,213 ****
return FromFile(filename, false);
}
- [TODO]
public static Image FromFile
(String filename, bool
useEmbeddedColorManagement)
{
! // TODO
! return null;
}
--- 237,246 ----
return FromFile(filename, false);
}
public static Image FromFile
(String filename, bool
useEmbeddedColorManagement)
{
! DotGNU.Images.Image image = new
DotGNU.Images.Image();
! image.Load(filename);
! return new Bitmap(image);
}
***************
*** 229,238 ****
return FromStream(stream, false);
}
- [TODO]
public static Image FromStream
(Stream stream, bool useEmbeddedColorManagement)
{
! // TODO
! return null;
}
--- 262,271 ----
return FromStream(stream, false);
}
public static Image FromStream
(Stream stream, bool useEmbeddedColorManagement)
{
! DotGNU.Images.Image image = new
DotGNU.Images.Image();
! image.Load(stream);
! return new Bitmap(image);
}
***************
*** 274,295 ****
// Get the number of bits per pixel in a specific format.
! public static int GetPixelFormatSize(PixelFormat pixfmt)
{
switch(pixfmt)
{
! case PixelFormat.Format1bppIndexed:
return 1;
! case PixelFormat.Format4bppIndexed:
return 4;
! case PixelFormat.Format8bppIndexed:
return 8;
! case PixelFormat.Format16bppRgb555:
! case PixelFormat.Format16bppRgb565:
! case PixelFormat.Format16bppArgb1555:
! case PixelFormat.Format16bppGrayScale:
return 16;
! case PixelFormat.Format24bppRgb:
return 24;
! case PixelFormat.Format32bppRgb:
! case PixelFormat.Format32bppPArgb:
! case PixelFormat.Format32bppArgb:
return 32;
! case PixelFormat.Format48bppRgb:
return 48;
! case PixelFormat.Format64bppPArgb:
! case PixelFormat.Format64bppArgb:
return 64;
}
return 0;
--- 307,337 ----
// Get the number of bits per pixel in a specific format.
! public static int GetPixelFormatSize
! (System.Drawing.Imaging.PixelFormat pixfmt)
{
switch(pixfmt)
{
! case
System.Drawing.Imaging.PixelFormat.Format1bppIndexed:
! return 1;
! case
System.Drawing.Imaging.PixelFormat.Format4bppIndexed:
! return 4;
! case
System.Drawing.Imaging.PixelFormat.Format8bppIndexed:
! return 8;
! case
System.Drawing.Imaging.PixelFormat.Format16bppRgb555:
! case
System.Drawing.Imaging.PixelFormat.Format16bppRgb565:
! case
System.Drawing.Imaging.PixelFormat.Format16bppArgb1555:
! case System.Drawing.Imaging.PixelFormat.
! Format16bppGrayScale:
return 16;
! case
System.Drawing.Imaging.PixelFormat.Format24bppRgb:
! return 24;
! case
System.Drawing.Imaging.PixelFormat.Format32bppRgb:
! case
System.Drawing.Imaging.PixelFormat.Format32bppPArgb:
! case
System.Drawing.Imaging.PixelFormat.Format32bppArgb:
! return 32;
! case
System.Drawing.Imaging.PixelFormat.Format48bppRgb:
! return 48;
! case
System.Drawing.Imaging.PixelFormat.Format64bppPArgb:
! case
System.Drawing.Imaging.PixelFormat.Format64bppArgb:
! return 64;
}
return 0;
***************
*** 318,332 ****
// Check for specific kinds of pixel formats.
! public static bool IsAlphaPixelFormat(PixelFormat pixfmt)
{
! return ((pixfmt & PixelFormat.Alpha) != 0);
}
! public static bool IsCanonicalPixelFormat(PixelFormat pixfmt)
{
! return ((pixfmt & PixelFormat.Canonical) != 0);
}
! public static bool IsExtendedPixelFormat(PixelFormat pixfmt)
{
! return ((pixfmt & PixelFormat.Extended) != 0);
}
--- 360,380 ----
// Check for specific kinds of pixel formats.
! public static bool IsAlphaPixelFormat
! (System.Drawing.Imaging.PixelFormat pixfmt)
{
! return ((pixfmt &
!
System.Drawing.Imaging.PixelFormat.Alpha) != 0);
}
! public static bool IsCanonicalPixelFormat
! (System.Drawing.Imaging.PixelFormat pixfmt)
{
! return ((pixfmt &
!
System.Drawing.Imaging.PixelFormat.Canonical) != 0);
}
! public static bool IsExtendedPixelFormat
! (System.Drawing.Imaging.PixelFormat pixfmt)
{
! return ((pixfmt &
!
System.Drawing.Imaging.PixelFormat.Extended) != 0);
}
Index: System.Drawing.build
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Drawing/System.Drawing.build,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** System.Drawing.build 21 Jun 2003 18:03:50 -0000 1.3
--- System.Drawing.build 10 Jul 2003 01:42:21 -0000 1.4
***************
*** 17,20 ****
--- 17,21 ----
<references>
<file name="../System/first/System.dll"/>
+ <file
name="../DotGNU.Images/DotGNU.Images.dll"/>
<file name="../DotGNU.SSL/DotGNU.SSL.dll"/>
<file name="../runtime/mscorlib.dll"/>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnetlib/System.Drawing Bitmap.cs, 1.2, 1.3 Image.cs, 1.2, 1.3 System.Drawing.build, 1.3, 1.4,
Rhys Weatherley <address@hidden> <=