Namespace: Consultingwerk.Util
Class 
ImageHelper Copy to Clipboard
Parent classes:
Inherits: Progress.Lang.Object

File:ImageHelper
Syntax:Static methods only, Protected constructor to disallow
instance creation
Author(s):Mike Fechner / Consultingwerk Ltd.
Created:Wed Jun 29 16:58:41 CEST 2011
Notes:This class is intented for GUI for .NET use only



Top Method Summary
Options Name Purpose
+ System.Drawing.Bitmap BuildTextImage (integer, integer, character, integer, character) Returns a System.Drawing.Bitmap that has been rendered from the passed in text
+ System.Drawing.Bitmap FromBLOB (handle, character) Converts a BLOB field from a Buffer handle into a System.Drawing.Bitmap
+ System.Drawing.Bitmap FromByteArray (Byte[]) Returns the Bitmap stored in the Byte[]
+ LOGICAL HasOleContainerHeader (Byte[]) Returns true when the Byte[] contains an OLE Image Header
+ System.Drawing.Bitmap Load (character) Loads an Image
+ System.Drawing.Icon LoadIcon (character) Loads an Icon
+ System.Drawing.Icon LoadIcon (character, Size) Loads an Icon
+ System.Drawing.Bitmap MakeTransparent (Bitmap) Adds transparency to a non transparent Bitmap

Top Constructor Summary
Options Name Purpose
# ImageHelper () Disallow instance creation


Method Detail
Top

PUBLIC System.Drawing.Bitmap BuildTextImage (integer, integer, character, integer, character)

Purpose: Returns a System.Drawing.Bitmap that has been rendered from the
passed in text
Notes: Useful for creating text-images for a Ribbon etc.

Parameters:
piImageWidth INTEGER
The width of the Image in pixels
piImageHeight INTEGER
The height of the Image in pixels
pcFontName CHARACTER
The name of the font to use for the Text
piFontSize INTEGER
The font size in Point
pcText CHARACTER
The text to render as a Bitmap
Returns System.Drawing.Bitmap
The Bitmap that has been rendered from the Text
Top

PUBLIC System.Drawing.Bitmap FromBLOB (handle, character)

Purpose: Converts a BLOB field from a Buffer handle into a System.Drawing.Bitmap
Notes: Creates a temporary Progress.Data.BindingSource to do the conversion
Verifies that a record is available in the buffer first

Parameters:
phBufferHandle HANDLE
The Buffer handle that contains the BLOB field
pcBufferField CHARACTER
The name of the BLOB field that contains the image data
Returns System.Drawing.Bitmap
The System.Drawing.Bitmap created from the BLOB data
Top

PUBLIC System.Drawing.Bitmap FromByteArray (Byte[])

Purpose: Returns the Bitmap stored in the Byte[]
Notes:

Parameters:
poImageData System.Byte[]
The Image data
Returns System.Drawing.Bitmap
The System.Drawing.Bitmap representing the Image
Top

PUBLIC LOGICAL HasOleContainerHeader (Byte[])

Purpose: Returns true when the Byte[] contains an OLE Image Header
Notes:

Parameters:
poImageData System.Byte[]
The Image data
Returns LOGICAL
Logical value indicating if the Byte[] contains an OLE Image Header
Top

PUBLIC System.Drawing.Bitmap Load (character)

Purpose: Loads an Image
Notes: Performs Propath lookup and loads the image without locking it
When the image name is not qualified with a file extension, we attempt
to load a .ico and .bmp (similar to the ABL behaviour).
This routine cannot load images from procedure libraries!

Parameters:
pcFileName CHARACTER
The image file name
Returns System.Drawing.Bitmap
The System.Drawing.Bitmap
Top

PUBLIC System.Drawing.Icon LoadIcon (character)

Purpose: Loads an Icon
Notes: Performs Propath lookup and loads the icon without locking it
When the icon name is not qualified with a file extension, we attempt
to load a .ico (similar to the ABL behaviour).
When no Size or an invalid size is given, we load the first Icon

Parameters:
pcFileName CHARACTER
The icon file name
Returns System.Drawing.Icon
The System.Drawing.Icon created
Top

PUBLIC System.Drawing.Icon LoadIcon (character, Size)

Purpose: Loads an Icon
Notes: Performs Propath lookup and loads the icon without locking it
When the icon name is not qualified with a file extension, we attempt
to load a .ico (similar to the ABL behaviour).
When no Size or an invalid size is given, we load the first Icon

Parameters:
pcFileName CHARACTER
The icon file name
poSize System.Drawing.Size
The preferred icon size to be returned
Returns System.Drawing.Icon
The System.Drawing.Icon created
Top

PUBLIC System.Drawing.Bitmap MakeTransparent (Bitmap)

Purpose: Adds transparency to a non transparent Bitmap
Notes: http://www.dotnet247.com/247reference/msgs/40/202528.aspx

Parameters:
poImage System.Drawing.Bitmap
The System.Drawing.Bitmap to make transparent
Returns System.Drawing.Bitmap
The reference to the generated transparent System.Drawing.Bitmap


Constructor Detail
Top

PROTECTED ImageHelper ()

Purpose: Disallow instance creation
Notes:



©2006-2016 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       26.08.2016 08:46:32