overview.hlp (Table of Contents; Topic list)
About Mouse Pointers and Icons (1.2)
Using Section  Function Group  System Pointers  Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
                       About Mouse Pointers and Icons
 
This topic describes how to use mouse pointers and icons in your
applications. You should also be familiar with the following topics:
 
    Messages and message queues
    MS OS/2 Resource Compiler
    Bitmaps
 
Mouse pointers are special bitmaps that MS OS/2 uses to show a user the
current location of the mouse on the screen. The mouse pointer moves around
the screen in response to user manipulation.
 
Mouse pointers are also used to draw icons on the screen, such as graphics
in message boxes and icons that represent minimized windows on the desktop.
The data structures for mouse pointers and icon bitmaps are identical.
 
Mouse Pointers and Icon Bitmaps
 
Mouse pointers and icons are made up of monochrome bitmaps that MS OS/2 uses
to paint an image of the pointer or icon on the screen. A monochrome bitmap
is a series of bytes. Each bit corresponds to a single pel in the image (the
bitmap representing the display typically has four bits for each pel).
 
A mouse pointer or icon bitmap is always twice as tall as it is wide. The
top half of the bitmap is an AND mask, where the bits are combined using the
AND operator with the screen bits where the pointer is being drawn. The
lower half of the bitmap is the XOR mask, which is combined using the XOR
operator with the destination screen bits.
 
The combination of the AND and XOR masks results in four possible colors in
the bitmap. The pels of an icon or pointer can be black, white, transparent
(the screen color beneath the pel), or inverted (inverting the screen color
beneath the pel). The following figure shows the relationship of the bit
values in the AND and XOR masks:
 
AND mask        0           0           1           1
XOR mask        0           1           0           1
 
Result        Black       White     Transparent   Inverted
 
Mouse-Pointer Hot Spot
 
Each mouse pointer has a hot spot defined as an x- and y-offset from the
lower-left corner of the mouse-pointer bitmap. The hot spot defines the
single point that represents the mouse-pointer location. For the
arrow-shaped pointer, the hot spot is at the tip of the arrow. For the
cross-hairs pointer, the hot spot is at the center of the cross. Each
pointer has its own hot spot.
 
 
                                      ♦