How do we create Sprites under connect?
I believe the function used to load these under the V8i SDK was Bentley::Ustn::ISprite::CreateFromIconResource (int rscId, void *hInstance).There was also a function Bentley::Ustn::IViewManager::CreateSpriteFromIcon (HICON__ *).
However in CONNECT nether of these are declared in the header files.
A dump from mdlbltin.lib reveals that some form of these functions exist.
Symbol name : ?CreateSpriteFromIcon@IViewManager@DgnPlatform@Bentley@@QEAAPEAUISprite@23@PEAUIcon@BeIconUtilities@3@_N@Z (public: struct Bentley::DgnPlatform::ISprite * __cdecl Bentley::DgnPlatform::IViewManager::CreateSpriteFromIcon(struct Bentley::BeIconUtilities::Icon *,bool)) Name : ?CreateSpriteFromIcon@IViewManager@DgnPlatform@Bentley@@QEAAPEAUISprite@23@PEAUIcon@BeIconUtilities@3@_N@Z Symbol name : ?LoadSpriteFromRsrc@IViewManager@DgnPlatform@Bentley@@SAPEAUISprite@23@HPEAUIconSource@BeIconUtilities@3@@Z (public: static struct Bentley::DgnPlatform::ISprite * __cdecl Bentley::DgnPlatform::IViewManager::LoadSpriteFromRsrc(int,struct Bentley::BeIconUtilities::IconSource *)) Name : ?LoadSpriteFromRsrc@IViewManager@DgnPlatform@Bentley@@SAPEAUISprite@23@HPEAUIconSource@BeIconUtilities@3@@Z
Am I missing something? Without these functions available how do we utilize sprites? Or is it recommended that we continue using transient elements?
ThanksLiam
Unknown said:How do we create Sprites under connect?
Search MicroStationAPI help for sprites. There's quite a bit of useful documentation, including an overview...
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.
...
#include <ISprite.h>
A Sprite, corresponding to a native Window manager icon.
Generally loaded once at startup via IViewManager::LoadSpriteFromRsrc and saved for the entire session. However, applications can implement this interface on other objects that are able to supply an icon resource.
However, I can't find method IViewManager::LoadSpriteFromRsrc, or anything similar, in any header file. That begs the question: "How do we load a sprite resource?"
Unknown said:Is it recommended that we continue using transient elements?
Transient elements represent geometry. Sprites are images, not geometry. They are used extensively by MicroStation — for example, an element handle is a sprite.
The transient API is more subtle in CONNECT. You can do things the old way, but new techniques simplify and extend your choices. You can, for example, draw pure geometry rather than elements.
Regards, Jon Summers LA Solutions
I suggest that you remove the Verified Answer status from my response. We need someone from Bentley Systems to tell us about IViewManager::LoadSpriteFromRsrc or its replacement. If the question is marked as answered, they may ignore this thread.
I too have asked this question.
Replied to: [CONNECT C++] ISprite::CreateFromIconResource() Unknown said: I don't see ISprite::CreateFromIconResource() MicroStationAPI help has this... A Sprite, corresponding to a native Window manager icon. Generally loaded once at startup via IViewManager… By Jon Summers over 7 years ago in MicroStation Programming > MicroStation Programming Forum
Hopefully someone at Bentley will provide more insight...
Bruce
Please note Defect #569256 was filed to address this issue to be fixed in a future release as noted in this thread: [CONNECT MicroStationAPI] IViewManager::LoadSpriteFromRsrc missing
UPDATE: MicroStation SDK version 10.07.00.39 resolves this issue