Sprites are (typically) small raster images that are drawn "on top" of Viewports by an IViewDecoration. More...


struct  ISprite
 A Sprite, corresponding to a native Window manager icon. More...
struct  SpriteLocation
 A Sprite Location. More...

Detailed Description

Sprites are (typically) small raster images that are drawn "on top" of Viewports by an IViewDecoration.

Their purpose is to draw the user's attention to something of importance.

There are two classes in the Sprites subsystem: ISprite (a Sprite Definition) and SpriteLocation. Sprite Definitions are the images that define the way a type of sprite looks and are generally loaded one time and saved for the rest of a session. A SpriteLocation defines the current position of a single Sprite in a Viewport.

A SpriteLocation can be either active or inactive. It becomes active by specifying a location (an x,y point) and a Sprite Definition to draw at that point. It should be obvious that a single Sprite Definition can be used many times by many Sprite Locations and that a single Sprite Location can change both position and which Sprite Definition is shown at that position over time.

Sprite definitions are generally created as Windows Icon resources, which are in turn Windows Bitmaps. Sprites can be of varying sizes and color depths and can have both opaque and transparent pixels. Icon Resources have a "hotspot" associated with them. The hotspot is the pixel that is the the "origin" of the sprite.

At a given time there can be many Sprites Locations shown in a Viewport. However, since the entire scene is refreshed from the backingStore for every frame (see discussion of Scene Creation in the detailed description of Viewports), and since Sprites are NOT stored in the backingStore, every IViewDecoration must (re)draw all of its SpriteLocations for every frame or they will disappear.

Element Manipulator handles and the Accusnap indicators are examples of MicroStation's use of Sprites.

It is also possible to draw an ISprite onto a Viewport directly (via calls to IViewDraw::DrawSprite) without ever using a SpriteLocation. SpriteLocations are merely provided as a convenience.

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.