Harlinn.Windows 0.1
Loading...
Searching...
No Matches
Harlinn::Windows::ImageList Class Reference

#include <HWStdCtrls.h>

Inheritance diagram for Harlinn::Windows::ImageList:
[legend]
Collaboration diagram for Harlinn::Windows::ImageList:
[legend]

Public Types

using Base = Handle<ImageList, HIMAGELIST>
 
- Public Types inherited from Harlinn::Common::Core::Handle< ImageList, HIMAGELIST >
using DerivedType
 
using HandleType
 

Public Member Functions

constexpr ImageList () noexcept
 
constexpr ImageList (HIMAGELIST handle, bool closeHandle=true) noexcept
 
 ImageList (int elementWidth, int elementHeight, int count, int growBy, ImageListFlags flags, ImageListColor color)
 Creates a new image list.
 
void Close () noexcept
 Destroys the image list.
 
int Add (const BitmapHandle &bitmap) const
 Adds an image or images to an image list.
 
int Add (const BitmapHandle &bitmap, const BitmapHandle &mask) const
 Adds an image or images to an image list.
 
int Add (const BitmapHandle &bitmap, COLORREF maskColor) const
 Adds an image or images to an image list, generating a mask from the specified bitmap.
 
void Move (int indexOfDestinationImage, int indexOfSourceImage) const
 The source image is copied to the destination image's index. This operation results in multiple instances of a given image.
 
void Swap (int indexOfFirstImage, int indexOfSecondImage) const
 The source and destination images exchange positions within the image list.
 
ImageList Clone () const
 Creates a duplicate of an existing image list.
 
void BeginDrag (int indexOfTrackImage, int dxHotspot, int dyHotspot) const
 Begins dragging an image.
 
void BeginDrag (int indexOfTrackImage, const POINT &hotspot) const
 Begins dragging an image.
 
void BeginDrag (int indexOfTrackImage, const Point &hotspot) const
 Begins dragging an image.
 
void Draw (int indexOfImage, HDC hDC, int x, int y, ImageListDrawFlags flags) const
 Draws an image list item in the specified device context.
 
void Draw (int indexOfImage, HDC hDC, int x, int y, int dx, int dy, COLORREF background, COLORREF foreground, ImageListDrawFlags flags) const
 Draws an image list item in the specified device context. The function uses the specified drawing style and blends the image with the specified color.
 
COLORREF GetBkColor () const
 Retrieves the current background color for an image list.
 
COLORREF BackgroundColor () const
 Retrieves the current background color for an image list.
 
IconHandle GetIcon (int indexOfImage, ImageListDrawFlags flags=ImageListDrawFlags::Normal) const
 Creates an icon from an image and mask in an image list.
 
void GetIconSize (int *x, int *y) const
 Retrieves the dimensions of images in an image list. All images in an image list have the same dimensions.
 
void GetIconSize (SIZE &size) const
 Retrieves the dimensions of images in an image list. All images in an image list have the same dimensions.
 
void GetIconSize (Size &size) const
 Retrieves the dimensions of images in an image list. All images in an image list have the same dimensions.
 
Size GetIconSize () const
 Retrieves the dimensions of images in an image list. All images in an image list have the same dimensions.
 
void GetImageSize (int *x, int *y) const
 Retrieves the dimensions of images in an image list. All images in an image list have the same dimensions.
 
void GetImageSize (SIZE &size) const
 Retrieves the dimensions of images in an image list. All images in an image list have the same dimensions.
 
void GetImageSize (Size &size) const
 Retrieves the dimensions of images in an image list. All images in an image list have the same dimensions.
 
Size GetImageSize () const
 Retrieves the dimensions of images in an image list. All images in an image list have the same dimensions.
 
int Count () const
 Retrieves the number of images in an image list.
 
void GetImageInfo (int imageIndex, IMAGEINFO &imageinfo) const
 Retrieves information about an image.
 
void GetImageInfo (int imageIndex, IMAGEINFO *imageinfo) const
 Retrieves information about an image.
 
ImageList Merge (int i1, HIMAGELIST himl2, int i2, int dx, int dy) const
 Creates a new image by combining two existing images. The function also creates a new image list in which to store the image.
 
bool Remove (int index) const
 Removes an image from the image list.
 
bool Replace (int index, HBITMAP image, HBITMAP mask) const
 Replaces an image in the image list with a new image.
 
int Replace (int index, HICON icon) const
 Replaces an image with an icon or cursor.
 
ColorRef SetBkColor (const ColorRef &newBackgroundColor) const
 Sets the background color for an image list. This function only works if you add an icon or use Add with a black and white bitmap. Without a mask, the entire image is drawn; hence the background color is not visible.
 
- Public Member Functions inherited from Harlinn::Common::Core::Handle< ImageList, HIMAGELIST >
 Handle (const Handle &other)=delete
 
 Handle (Handle &&other) noexcept
 
virtual ~Handle () noexcept
 
constexpr bool IsValid () const noexcept
 
Handleoperator= (Handle &other)=delete
 
Handleoperator= (Handle &&other) noexcept
 
constexpr auto operator<=> (const Handle &other) const noexcept
 
constexpr auto operator<=> (HandleType handle) const noexcept
 
constexpr bool operator== (const Handle &other) const noexcept
 
constexpr bool operator== (HandleType handle) const noexcept
 
constexpr operator HandleType () const noexcept
 
constexpr HandleType Value () const noexcept
 
constexpr bool OwnsHandle () const noexcept
 

Static Public Member Functions

static void DragEnter (HWND hwndLock, int x, int y)
 Displays the drag image at the specified position within the window.
 
static void DragEnter (Control &control, int x, int y)
 Displays the drag image at the specified position within the control.
 
static void DragLeave (HWND hwndLock)
 Unlocks the specified window and hides the drag image, allowing the window to be updated.
 
static void DragLeave (Control &control)
 Unlocks the specified control and hides the drag image, allowing the control to be updated.
 
static void DragMove (int x, int y)
 Moves the image that is being dragged during a drag-and-drop operation. This function is typically called in response to a WM_MOUSEMOVE message.
 
static void DragShowNolock (bool showImage)
 Shows or hides the image being dragged.
 
static void EndDrag ()
 Ends a drag operation.
 
static ImageList GetDragImage (POINT *ppt, POINT *pptHotspot)
 Retrieves the temporary image list that is used for the drag image. The function also retrieves the current drag position and the offset of the drag image relative to the drag position.
 
static ImageList GetDragImage (Point *ppt, Point *pptHotspot)
 Retrieves the temporary image list that is used for the drag image. The function also retrieves the current drag position and the offset of the drag image relative to the drag position.
 
static void Draw (const IMAGELISTDRAWPARAMS *imagelistDrawOarams)
 Draws an image list image based on an IMAGELISTDRAWPARAMS structure.
 
static void Draw (const IMAGELISTDRAWPARAMS &imagelistDrawParams)
 Draws an image list image based on an IMAGELISTDRAWPARAMS structure.
 
static ImageList Load (HINSTANCE hInstance, const wchar_t *name, int imageWidth, int growBy, COLORREF maskColor, ImageListLoadFlags flags)
 Creates an image list from the specified bitmap.
 
static ImageList LoadFromFile (const wchar_t *name, int imageWidth, int growBy, COLORREF maskColor, ImageListLoadFlags flags)
 Creates an image list from the specified bitmap.
 
static ImageList LoadFromFile (const wchar_t *name, int imageWidth)
 Creates an image list from the specified bitmap.
 
static ImageList Merge (HIMAGELIST himl1, int i1, HIMAGELIST himl2, int i2, int dx, int dy)
 Creates a new image by combining two existing images. The function also creates a new image list in which to store the image.
 
static ImageList Read (LPSTREAM stream)
 Reads an image list from a stream.
 
- Static Public Member Functions inherited from Harlinn::Common::Core::Handle< ImageList, HIMAGELIST >
static constexpr HandleType InvalidHandleValue () noexcept
 

Static Private Member Functions

static HIMAGELIST CreateImageList (int elementWidth, int elementHeight, int count, int growBy, ImageListFlags flags, ImageListColor color)
 

Additional Inherited Members

- Protected Member Functions inherited from Harlinn::Common::Core::Handle< ImageList, HIMAGELIST >
constexpr Handle () noexcept
 
constexpr Handle (HandleType handle, bool ownsHandle=true) noexcept
 
void SetValue (HandleType handle, bool ownsHandle=true)
 
- Protected Attributes inherited from Harlinn::Common::Core::Handle< ImageList, HIMAGELIST >
HandleType value_
 

Member Typedef Documentation

◆ Base

Constructor & Destructor Documentation

◆ ImageList() [1/3]

Harlinn::Windows::ImageList::ImageList ( )
inlineconstexprnoexcept

◆ ImageList() [2/3]

Harlinn::Windows::ImageList::ImageList ( HIMAGELIST handle,
bool closeHandle = true )
inlineexplicitconstexprnoexcept

◆ ImageList() [3/3]

Harlinn::Windows::ImageList::ImageList ( int elementWidth,
int elementHeight,
int count,
int growBy,
ImageListFlags flags,
ImageListColor color )
inline

Creates a new image list.

Parameters
elementWidthThe width, in pixels, of each image
elementHeightThe height, in pixels, of each image
countThe number of images that the image list initially contains.
growByThe number of images by which the image list can grow when the system needs to make room for new images. This parameter represents the number of new images that the resized image list can contain.
flagsA set of bit flags that specify the type of image list to create.
colorSpecifies the color-depth of the imagelist

Member Function Documentation

◆ Add() [1/3]

int Harlinn::Windows::ImageList::Add ( const BitmapHandle & bitmap) const
inline

Adds an image or images to an image list.

Parameters
bitmapA handle to the bitmap that contains the image or images. The number of images is inferred from the width of the bitmap.
Returns
Returns the index of the first new image

◆ Add() [2/3]

int Harlinn::Windows::ImageList::Add ( const BitmapHandle & bitmap,
COLORREF maskColor ) const
inline

Adds an image or images to an image list, generating a mask from the specified bitmap.

Parameters
bitmapA handle to the bitmap that contains one or more images. The number of images is inferred from the width of the bitmap.
maskColorThe color used to generate the mask. Each pixel of this color in the specified bitmap is changed to black, and the corresponding bit in the mask is set to 1.
Returns
Returns the index of the first new image

◆ Add() [3/3]

int Harlinn::Windows::ImageList::Add ( const BitmapHandle & bitmap,
const BitmapHandle & mask ) const
inline

Adds an image or images to an image list.

Parameters
bitmapA handle to the bitmap that contains the image or images. The number of images is inferred from the width of the bitmap.
maskA handle to the bitmap that contains the mask. If no mask is used with the image list, this parameter is ignored.
Returns
Returns the index of the first new image

◆ BackgroundColor()

COLORREF Harlinn::Windows::ImageList::BackgroundColor ( ) const
inline

Retrieves the current background color for an image list.

Returns
The return value is the background color.

◆ BeginDrag() [1/3]

void Harlinn::Windows::ImageList::BeginDrag ( int indexOfTrackImage,
const POINT & hotspot ) const
inline

Begins dragging an image.

Parameters
indexOfTrackImageThe index of the image to drag.
hotspotThe x and y coordinates of the location of the drag position relative to the upper-left corner of the image.

◆ BeginDrag() [2/3]

void Harlinn::Windows::ImageList::BeginDrag ( int indexOfTrackImage,
const Point & hotspot ) const
inline

Begins dragging an image.

Parameters
indexOfTrackImageThe index of the image to drag.
hotspotThe x and y coordinates of the location of the drag position relative to the upper-left corner of the image.

◆ BeginDrag() [3/3]

void Harlinn::Windows::ImageList::BeginDrag ( int indexOfTrackImage,
int dxHotspot,
int dyHotspot ) const
inline

Begins dragging an image.

Parameters
indexOfTrackImageThe index of the image to drag.
dxHotspotThe x-coordinate of the location of the drag position relative to the upper-left corner of the image.
dyHotspotThe y-coordinate of the location of the drag position relative to the upper-left corner of the image.

◆ Clone()

ImageList Harlinn::Windows::ImageList::Clone ( ) const
inline

Creates a duplicate of an existing image list.

Returns
the duplicate

◆ Close()

void Harlinn::Windows::ImageList::Close ( )
inlinenoexcept

Destroys the image list.

◆ Count()

int Harlinn::Windows::ImageList::Count ( ) const
inline

Retrieves the number of images in an image list.

Returns
Returns the number of images.

◆ CreateImageList()

static HIMAGELIST Harlinn::Windows::ImageList::CreateImageList ( int elementWidth,
int elementHeight,
int count,
int growBy,
ImageListFlags flags,
ImageListColor color )
inlinestaticprivate

◆ DragEnter() [1/2]

static void Harlinn::Windows::ImageList::DragEnter ( Control & control,
int x,
int y )
inlinestatic

Displays the drag image at the specified position within the control.

Parameters
controlThe control that owns the drag image.
xThe x-coordinate at which to display the drag image. The coordinate is relative to the upper-left corner of the control, not the client area.
yThe y-coordinate at which to display the drag image. The coordinate is relative to the upper-left corner of the control, not the client area.

◆ DragEnter() [2/2]

static void Harlinn::Windows::ImageList::DragEnter ( HWND hwndLock,
int x,
int y )
inlinestatic

Displays the drag image at the specified position within the window.

Parameters
hwndLockA handle to the window that owns the drag image.
xThe x-coordinate at which to display the drag image. The coordinate is relative to the upper-left corner of the window, not the client area.
yThe y-coordinate at which to display the drag image. The coordinate is relative to the upper-left corner of the window, not the client area.

◆ DragLeave() [1/2]

static void Harlinn::Windows::ImageList::DragLeave ( Control & control)
inlinestatic

Unlocks the specified control and hides the drag image, allowing the control to be updated.

Parameters
controlThe Control that owns the drag image

◆ DragLeave() [2/2]

static void Harlinn::Windows::ImageList::DragLeave ( HWND hwndLock)
inlinestatic

Unlocks the specified window and hides the drag image, allowing the window to be updated.

Parameters
hwndLockA handle to the window that owns the drag image

◆ DragMove()

static void Harlinn::Windows::ImageList::DragMove ( int x,
int y )
inlinestatic

Moves the image that is being dragged during a drag-and-drop operation. This function is typically called in response to a WM_MOUSEMOVE message.

Parameters
xThe x-coordinate at which to display the drag image. The coordinate is relative to the upper-left corner of the window, not the client area.
yThe y-coordinate at which to display the drag image. The coordinate is relative to the upper-left corner of the window, not the client area.

◆ DragShowNolock()

static void Harlinn::Windows::ImageList::DragShowNolock ( bool showImage)
inlinestatic

Shows or hides the image being dragged.

Parameters
showImageA value specifying whether to show or hide the image being dragged. Specify true to show the image or false to hide the image.

◆ Draw() [1/4]

static void Harlinn::Windows::ImageList::Draw ( const IMAGELISTDRAWPARAMS & imagelistDrawParams)
inlinestatic

Draws an image list image based on an IMAGELISTDRAWPARAMS structure.

Parameters
imagelistDrawParamsA reference to an IMAGELISTDRAWPARAMS structure that contains information about the draw operation.

◆ Draw() [2/4]

static void Harlinn::Windows::ImageList::Draw ( const IMAGELISTDRAWPARAMS * imagelistDrawOarams)
inlinestatic

Draws an image list image based on an IMAGELISTDRAWPARAMS structure.

Parameters
imagelistDrawOaramsA pointer to an IMAGELISTDRAWPARAMS structure that contains information about the draw operation.

◆ Draw() [3/4]

void Harlinn::Windows::ImageList::Draw ( int indexOfImage,
HDC hDC,
int x,
int y,
ImageListDrawFlags flags ) const
inline

Draws an image list item in the specified device context.

Parameters
indexOfImageThe index of the image to draw.
hDCA handle to the destination device context.
xThe x-coordinate at which to draw within the specified device context.
yThe y-coordinate at which to draw within the specified device context.
flagsThe drawing style and, optionally, the overlay image.

◆ Draw() [4/4]

void Harlinn::Windows::ImageList::Draw ( int indexOfImage,
HDC hDC,
int x,
int y,
int dx,
int dy,
COLORREF background,
COLORREF foreground,
ImageListDrawFlags flags ) const
inline

Draws an image list item in the specified device context. The function uses the specified drawing style and blends the image with the specified color.

Parameters
indexOfImageThe index of the image to draw.
hDCA handle to the destination device context.
xThe x-coordinate at which to draw within the specified device context.
yThe y-coordinate at which to draw within the specified device context.
dxThe width of the portion of the image to draw relative to the upper-left corner of the image. If dx and dy are zero, the function draws the entire image. The function does not ensure that the parameters are valid.
dyThe height of the portion of the image to draw, relative to the upper-left corner of the image. If dx and dy are zero, the function draws the entire image. The function does not ensure that the parameters are valid.
backgroundThe background color of the image. This parameter can be an application-defined RGB value or one of the following values:
  • CLR_NONE: No background color. The image is drawn transparently.
  • CLR_DEFAULT: The default background color. The image is drawn using the background color of the image list.
foregroundThe foreground color of the image. This parameter can be an application-defined RGB value or one of the following values:
  • CLR_NONE: No blend color. The image is blended with the color of the destination device context.
  • CLR_DEFAULT: The default foreground color. The image is drawn using the system highlight color as the foreground color.
flags

◆ EndDrag()

static void Harlinn::Windows::ImageList::EndDrag ( )
inlinestatic

Ends a drag operation.

◆ GetBkColor()

COLORREF Harlinn::Windows::ImageList::GetBkColor ( ) const
inline

Retrieves the current background color for an image list.

Returns
The return value is the background color.

◆ GetDragImage() [1/2]

static ImageList Harlinn::Windows::ImageList::GetDragImage ( POINT * ppt,
POINT * pptHotspot )
inlinestatic

Retrieves the temporary image list that is used for the drag image. The function also retrieves the current drag position and the offset of the drag image relative to the drag position.

Parameters
pptA pointer to a POINT structure that receives the current drag position. Can be nullptr.
pptHotspotA pointer to a POINT structure that receives the offset of the drag image relative to the drag position. Can be nullptr.

The temporary image list is destroyed when the EndDrag function is called. To begin a drag operation, use the ImageList::BeginDrag function.

Returns
Returns the handle to the image list

◆ GetDragImage() [2/2]

static ImageList Harlinn::Windows::ImageList::GetDragImage ( Point * ppt,
Point * pptHotspot )
inlinestatic

Retrieves the temporary image list that is used for the drag image. The function also retrieves the current drag position and the offset of the drag image relative to the drag position.

Parameters
pptA pointer to a Point object that receives the current drag position. Can be nullptr.
pptHotspotA pointer to a Point object that receives the offset of the drag image relative to the drag position. Can be nullptr.

The temporary image list is destroyed when the EndDrag function is called. To begin a drag operation, use the ImageList::BeginDrag function.

Returns
Returns the handle to the image list

◆ GetIcon()

IconHandle Harlinn::Windows::ImageList::GetIcon ( int indexOfImage,
ImageListDrawFlags flags = ImageListDrawFlags::Normal ) const
inline

Creates an icon from an image and mask in an image list.

Parameters
indexOfImageAn index of the image.
flagsA combination of flags that specify the drawing style
Returns
Returns the handle to the icon

◆ GetIconSize() [1/4]

Size Harlinn::Windows::ImageList::GetIconSize ( ) const
inline

Retrieves the dimensions of images in an image list. All images in an image list have the same dimensions.

Returns
A Size object with the width and height, in pixels, of each image.

◆ GetIconSize() [2/4]

void Harlinn::Windows::ImageList::GetIconSize ( int * x,
int * y ) const
inline

Retrieves the dimensions of images in an image list. All images in an image list have the same dimensions.

Parameters
xA pointer to an integer variable that receives the width, in pixels, of each image.
yA pointer to an integer variable that receives the height, in pixels, of each image.

◆ GetIconSize() [3/4]

void Harlinn::Windows::ImageList::GetIconSize ( SIZE & size) const
inline

Retrieves the dimensions of images in an image list. All images in an image list have the same dimensions.

Parameters
sizeA reference to a SIZE structure that receives the width and height, in pixels, of each image.

◆ GetIconSize() [4/4]

void Harlinn::Windows::ImageList::GetIconSize ( Size & size) const
inline

Retrieves the dimensions of images in an image list. All images in an image list have the same dimensions.

Parameters
sizeA reference to a Size object that receives the width and height, in pixels, of each image.

◆ GetImageInfo() [1/2]

void Harlinn::Windows::ImageList::GetImageInfo ( int imageIndex,
IMAGEINFO & imageinfo ) const
inline

Retrieves information about an image.

An application should not call DeleteObject to destroy the bitmaps retrieved by GetImageInfo. The system destroys the bitmaps when the imagelist is desroyed.

Parameters
imageIndexThe index of the image.
imageinfoA reference to an IMAGEINFO structure that receives information about the image. The information in this structure can be used to directly manipulate the bitmaps for the image.

◆ GetImageInfo() [2/2]

void Harlinn::Windows::ImageList::GetImageInfo ( int imageIndex,
IMAGEINFO * imageinfo ) const
inline

Retrieves information about an image.

An application should not call DeleteObject to destroy the bitmaps retrieved by GetImageInfo. The system destroys the bitmaps when the imagelist is desroyed.

Parameters
imageIndexThe index of the image.
imageinfoA pointer to an IMAGEINFO structure that receives information about the image. The information in this structure can be used to directly manipulate the bitmaps for the image.

◆ GetImageSize() [1/4]

Size Harlinn::Windows::ImageList::GetImageSize ( ) const
inline

Retrieves the dimensions of images in an image list. All images in an image list have the same dimensions.

Returns
A Size object with the width and height, in pixels, of each image.

◆ GetImageSize() [2/4]

void Harlinn::Windows::ImageList::GetImageSize ( int * x,
int * y ) const
inline

Retrieves the dimensions of images in an image list. All images in an image list have the same dimensions.

Parameters
xA pointer to an integer variable that receives the width, in pixels, of each image.
yA pointer to an integer variable that receives the height, in pixels, of each image.

◆ GetImageSize() [3/4]

void Harlinn::Windows::ImageList::GetImageSize ( SIZE & size) const
inline

Retrieves the dimensions of images in an image list. All images in an image list have the same dimensions.

Parameters
sizeA reference to a SIZE structure that receives the width and height, in pixels, of each image.

◆ GetImageSize() [4/4]

void Harlinn::Windows::ImageList::GetImageSize ( Size & size) const
inline

Retrieves the dimensions of images in an image list. All images in an image list have the same dimensions.

Parameters
sizeA reference to a Size object that receives the width and height, in pixels, of each image.

◆ Load()

static ImageList Harlinn::Windows::ImageList::Load ( HINSTANCE hInstance,
const wchar_t * name,
int imageWidth,
int growBy,
COLORREF maskColor,
ImageListLoadFlags flags )
inlinestatic

Creates an image list from the specified bitmap.

Parameters
hInstanceA handle to the instance that contains the resource.
nameThe address of a null-terminated string that contains the name of the image resource in the module
imageWidthThe width of each image. The height of each image and the initial number of images are inferred by the dimensions of the specified resource.
growByThe number of images by which the image list can grow when the system needs to make room for new images. This parameter represents the number of new images that the resized image list can contain.
maskColorThe color used to generate a mask. Each pixel of this color in the specified bitmap, cursor, or icon is changed to black, and the corresponding bit in the mask is set to 1. If this parameter is the CLR_NONE value, no mask is generated. If this parameter is the CLR_DEFAULT value, the color of the pixel at the upper-left corner of the image is treated as the mask color.
flagsFlags that specify how to load the image
Returns
Returns the handle to the image list

◆ LoadFromFile() [1/2]

static ImageList Harlinn::Windows::ImageList::LoadFromFile ( const wchar_t * name,
int imageWidth )
inlinestatic

Creates an image list from the specified bitmap.

Parameters
nameThe address of a null-terminated string that names the file containing the image to load.
imageWidthThe width of each image. The height of each image and the initial number of images are inferred by the dimensions of the specified resource.
Returns
Returns the handle to the image list

◆ LoadFromFile() [2/2]

static ImageList Harlinn::Windows::ImageList::LoadFromFile ( const wchar_t * name,
int imageWidth,
int growBy,
COLORREF maskColor,
ImageListLoadFlags flags )
inlinestatic

Creates an image list from the specified bitmap.

Parameters
nameThe address of a null-terminated string that names the file containing the image to load.
imageWidthThe width of each image. The height of each image and the initial number of images are inferred by the dimensions of the specified resource.
growByThe number of images by which the image list can grow when the system needs to make room for new images. This parameter represents the number of new images that the resized image list can contain.
maskColorThe color used to generate a mask. Each pixel of this color in the specified bitmap, cursor, or icon is changed to black, and the corresponding bit in the mask is set to 1. If this parameter is the CLR_NONE value, no mask is generated. If this parameter is the CLR_DEFAULT value, the color of the pixel at the upper-left corner of the image is treated as the mask color.
flagsFlags that specify how to load the image
Returns
Returns the handle to the image list

◆ Merge() [1/2]

static ImageList Harlinn::Windows::ImageList::Merge ( HIMAGELIST himl1,
int i1,
HIMAGELIST himl2,
int i2,
int dx,
int dy )
inlinestatic

Creates a new image by combining two existing images. The function also creates a new image list in which to store the image.

Parameters
himl1A handle to the first image list.
i1The index of the first existing image.
himl2A handle to the second image list.
i2The index of the second existing image.
dxThe x-offset of the second image relative to the first image.
dyThe y-offset of the second image relative to the first image.
Returns
Returns the handle to the new image list

◆ Merge() [2/2]

ImageList Harlinn::Windows::ImageList::Merge ( int i1,
HIMAGELIST himl2,
int i2,
int dx,
int dy ) const
inline

Creates a new image by combining two existing images. The function also creates a new image list in which to store the image.

Parameters
i1The index of the first existing image.
himl2A handle to the second image list.
i2The index of the second existing image.
dxThe x-offset of the second image relative to the first image.
dyThe y-offset of the second image relative to the first image.
Returns
Returns the handle to the new image list

◆ Move()

void Harlinn::Windows::ImageList::Move ( int indexOfDestinationImage,
int indexOfSourceImage ) const
inline

The source image is copied to the destination image's index. This operation results in multiple instances of a given image.

Parameters
indexOfDestinationImageThe zero-based index of the image to be used as the destination of the copy operation.
indexOfSourceImageThe zero-based index of the image to be used as the source of the copy operation.

◆ Read()

static ImageList Harlinn::Windows::ImageList::Read ( LPSTREAM stream)
inlinestatic

Reads an image list from a stream.

Parameters
streamA pointer to the stream
Returns
Returns the handle to the image list

◆ Remove()

bool Harlinn::Windows::ImageList::Remove ( int index) const
inline

Removes an image from the image list.

Parameters
indexThe index of the image to remove. If this parameter is -1, the function removes all images.
Returns
Returns true if successful, or false if not.

◆ Replace() [1/2]

bool Harlinn::Windows::ImageList::Replace ( int index,
HBITMAP image,
HBITMAP mask ) const
inline

Replaces an image in the image list with a new image.

Parameters
indexThe index of the image to replace
imageThe handle to the bitmap that contains the new image.
maskThe handle to the bitmap that contains the mask. If no mask is used with the image list, this parameter is ignored.
Returns
Returns true if successful, or false otherwise

◆ Replace() [2/2]

int Harlinn::Windows::ImageList::Replace ( int index,
HICON icon ) const
inline

Replaces an image with an icon or cursor.

Parameters
indexThe index of the image to replace. If index is -1, the function appends the image to the end of the list.
iconThe handle to the icon or cursor that contains the bitmap and mask for the new image.
Returns
Returns the index of the image if successful, or -1 if not.

◆ SetBkColor()

ColorRef Harlinn::Windows::ImageList::SetBkColor ( const ColorRef & newBackgroundColor) const
inline

Sets the background color for an image list. This function only works if you add an icon or use Add with a black and white bitmap. Without a mask, the entire image is drawn; hence the background color is not visible.

Parameters
newBackgroundColorThe background color to set. This parameter can be the value returned from ColorRef::None( ), CLR_NONE, value; in which case, images are drawn transparently using the mask.
Returns
Returns the previous background color if successful, or CLR_NONE otherwise.

◆ Swap()

void Harlinn::Windows::ImageList::Swap ( int indexOfFirstImage,
int indexOfSecondImage ) const
inline

The source and destination images exchange positions within the image list.

Parameters
indexOfFirstImageThe zero-based index of the first image
indexOfSecondImageThe zero-based index of the second image

The documentation for this class was generated from the following file: