CVB.Net 14.0
DrawingExtensions Class Reference

Extension methods for the members of the System.Drawing namespace. More...

Static Public Member Functions

static void DrawImage (this Graphics dc, Image img, Rect sourceRect, Rect targetRect, PlaneConfiguration planes, double gain, int offset, HighBitScaleMode mode)
 Draw a Image object into a Graphics object. More...
 
static void DrawImage (this Graphics dc, Image img, Rect sourceRect, Rect targetRect, HighBitScaleMode mode)
 Draw a Image object into a Graphics object. More...
 
static void DrawImage (this Graphics dc, Image img, Rect targetRect, HighBitScaleMode mode)
 Draw a Image object into a Graphics object. More...
 
static void DrawImage (this Graphics dc, Image img, HighBitScaleMode mode)
 Draw a Image object into a Graphics object. Target rectangle is defined by the image's extent. More...
 
static Image ToImage (this Bitmap bitmap)
 Creates a new Stemmer.Cvb.Image and copies the data from the given bitmap . More...
 
static Size2D ToSize2D (this Size sz)
 Converts the given Size sz to a CvbSize. More...
 
static Size2D ToSize2D (SizeF sz)
 Converts the given SizeF sz to a SizeD. More...
 
static WrappedImage ToCvbWrappedImage (this BitmapData bmData)
 Wraps, without copying, the given bmData pixel buffer in a Stemmer.Cvb.ImageImage. More...
 
static Point2Dd ToPoint2Dd (this PointF p)
 Create a PointD from a PointF object. More...
 
static Point2Dd ToPoint2Dd (this Point p)
 Create a PointD from a Point. More...
 
static Point2D ToPoint2D (this Point p)
 Create a CvbPoint from a Point. More...
 
static Size2Dd ToSize2Dd (this SizeF sz)
 Converts the given SizeF sz to a CvbSizeD. More...
 
static RgbColor ToColor (this System.Drawing.Color clr)
 Convert the given System.Drawing.Color to a RgbColor structure. More...
 

Detailed Description

Extension methods for the members of the System.Drawing namespace.

Member Function Documentation

◆ DrawImage() [1/4]

static void DrawImage ( this Graphics  dc,
Image  img,
HighBitScaleMode  mode 
)
static

Draw a Image object into a Graphics object. Target rectangle is defined by the image's extent.

Parameters
dcGraphics object to paint to
imgImage to paint
modeTreatment for images with more than 8 bits per pixel
Exceptions
ArgumentNullExceptionIf dc is null

◆ DrawImage() [2/4]

static void DrawImage ( this Graphics  dc,
Image  img,
Rect  sourceRect,
Rect  targetRect,
HighBitScaleMode  mode 
)
static

Draw a Image object into a Graphics object.

Parameters
dcGraphics object to paint to
imgImage to paint
sourceRectSubsection of the image to paint
targetRectRectangle in the target dc to paint to
modeTreatment for images with more than 8 bits per pixel
Exceptions
ArgumentNullExceptionIf dc is null

◆ DrawImage() [3/4]

static void DrawImage ( this Graphics  dc,
Image  img,
Rect  sourceRect,
Rect  targetRect,
PlaneConfiguration  planes,
double  gain,
int  offset,
HighBitScaleMode  mode 
)
static

Draw a Image object into a Graphics object.

Parameters
dcGraphics object to paint to
imgImage to paint
sourceRectSubsection of the image to paint
targetRectRectangle in the target dc to paint to
planesPlane configuration to use
gainGain to apply
offsetOffset to apply
modeTreatment for images with more than 8 bits per pixel. Note that setting this mode to
HighbitScaleMode.ViewPort
cause the function to ignore the gain and offset setting.
Exceptions
ArgumentNullExceptionIf dc is null or img is null
ObjectDisposedExceptionIf the img has already been disposed

◆ DrawImage() [4/4]

static void DrawImage ( this Graphics  dc,
Image  img,
Rect  targetRect,
HighBitScaleMode  mode 
)
static

Draw a Image object into a Graphics object.

Parameters
dcGraphics object to paint to
imgImage to paint
targetRectRectangle in the target dc to paint to
modeTreatment for images with more than 8 bits per pixel
Exceptions
ArgumentNullExceptionIf dc is null

◆ ToColor()

static RgbColor ToColor ( this System.Drawing.Color  clr)
static

Convert the given System.Drawing.Color to a RgbColor structure.

Parameters
clrColor to be converted.
Returns
Converted color.

◆ ToCvbWrappedImage()

static WrappedImage ToCvbWrappedImage ( this BitmapData  bmData)
static

Wraps, without copying, the given bmData pixel buffer in a Stemmer.Cvb.ImageImage.

Parameters
bmDataBitmap data to wrap.
Returns
Newly created image.
Exceptions
NotImplementedExceptionBitmap pixel format not supported.

◆ ToImage()

static Image ToImage ( this Bitmap  bitmap)
static

Creates a new Stemmer.Cvb.Image and copies the data from the given bitmap .

Parameters
bitmapBitmap to copy into new Image.
Returns
New Image object.
Exceptions
NotImplementedExceptionBitmap pixel format not supported.
InsufficientMemoryExceptionThe new image buffer could not be created.
CvbExceptionIf image format could not be cloned.

◆ ToPoint2D()

static Point2D ToPoint2D ( this Point  p)
static

Create a CvbPoint from a Point.

Parameters
pPoint to be converted.
Returns
Converted Point2D object.

◆ ToPoint2Dd() [1/2]

static Point2Dd ToPoint2Dd ( this Point  p)
static

Create a PointD from a Point.

Parameters
pPoint to initialize with
Returns
Converted Point2Dd object.

◆ ToPoint2Dd() [2/2]

static Point2Dd ToPoint2Dd ( this PointF  p)
static

Create a PointD from a PointF object.

Parameters
pdata to initialize with
Returns
Converted Point2Dd object.

◆ ToSize2D() [1/2]

static Size2D ToSize2D ( SizeF  sz)
static

Converts the given SizeF sz to a SizeD.

Parameters
szSize to convert.
Returns
New SizeD

.

◆ ToSize2D() [2/2]

static Size2D ToSize2D ( this Size  sz)
static

Converts the given Size sz to a CvbSize.

Parameters
szSize to convert.
Returns
New SizeD

.

◆ ToSize2Dd()

static Size2Dd ToSize2Dd ( this SizeF  sz)
static

Converts the given SizeF sz to a CvbSizeD.

Parameters
szSize to convert.
Returns
New SizeD

.