The MicroStationAPI documentation about Sprites mentions static method IViewManager::LoadSpriteFromRsrc(). However, that function is not available in any public header file.
Shouldn't that function be published? Is there another way to load a sprite image?
.
Regards, Jon Summers LA Solutions
Hi Jon,
I have filed Defect # 569256 to address this issue with missing method in header files.
Best regards,
Artur
Answer Verified By: Jon Summers
Defect #569256 in part has been resolved in MicroStation CONNECT Edition SDK Update 7, by exporting the following declaration to load sprites:
..\include\Mstn\MdlApi\msw32utl.fdf:238:MSCORE_EXPORT DgnPlatform::ISprite* mdlViewManager_loadSpriteFromRsrc (int rsrcId, HINSTANCE* hInstancePtr);
HTH,Bob
Unknown said:Defect #569256 in part has been resolved in MicroStation CONNECT Edition SDK Update 7
I notice your careful wording. When you write 'in part has been resolved', I infer that something else must happen to make it fully resolved. Or am I being too excitable while channelling Sherlock Holmes?
That it's been resolved, even if only partially, is welcome news!
There must be more "secret sauce" needed to make this work. I tried to use mdlViewManager_loadSpriteFromRsrc() and wasn't able to make it work. Could be the definition of "rsrc". In pre-CONNECT, you could load an icon that was stored in a .dll. My attempt today was to pass the HINSTANCE of my .dll with the Icon resource into the function. I got a null ptr returned from the function...
int iconID = IDI_ICON1; HINSTANCE myDll = GetModuleHandleW(L"srs_viewMonitorConnect"); m_oSpriteP = mdlViewManager_loadSpriteFromRsrc(iconID, &myDll);
Bruce Reeves SRNS said:There must be more "secret sauce" needed to make this work
I've been slaving in the kitchen, making secret sprite sauce. The tricky part is to catch your sprite.
Here's an article about View Decoration for MicroStation CONNECT Update 8 and later. I don't know if the API was available prior to that version, which is my development platform in April 2018.
That page includes a link to download a C++ project to display a sprite in MicroStation.
I too have been "cooking in the kitchen" and did (finally) get an icon to load and act as a sprite. We'll have to compare recipes....