Animated GIF in XAML not showing |
Post Reply |
Author | |
evoX
Senior Member Joined: 25 July 2007 Status: Offline Points: 207 |
Post Options
Thanks(0)
Posted: 06 October 2016 at 6:03am |
I have this code to load an animated GIF from resource
HBITMAP hbm = NULL; CBitmap bmpLogo; BOOL bAlpha = TRUE; UINT nImageID = 1; hbm = CXTPImageManagerIcon::LoadBitmapFromResource(m_hResourceModule, MAKEINTRESOURCE(IDR_GIF_ROTATING_GEAR), &bAlpha); bmpLogo.Attach(hbm); XTPImageManager()->RemoveIcon(nImageID); XTPImageManager()->SetIcons(bmpLogo, &nImageID, 1, CSize(0, 0), xtpImageNormal, TRUE); In resource the image is added as a custom resource called GIF The Image ID is set correctly in XAML, but the GIF is not displayed. I also have tried to set the CSize to 64,64 as the GIF size, but the same result.
|
|
Product: Xtreme ToolkitPro 19.30
Platform: Windows 10 64bit Language: Visual C++ (VS 2019) |
|
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
Hello evoX,
You can explore our sample Samples\Utilities\MarkupPad, load file Markups\Smiles.xaml
Regards, Oleksandr Lebed |
|
evoX
Senior Member Joined: 25 July 2007 Status: Offline Points: 207 |
Post Options
Thanks(0)
|
I have seen the sample, from a stand alone .GIF file it works, but loading it from resource does not work :(
|
|
Product: Xtreme ToolkitPro 19.30
Platform: Windows 10 64bit Language: Visual C++ (VS 2019) |
|
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
Oh, you mean that necessary picture is in some DLL..
|
|
evoX
Senior Member Joined: 25 July 2007 Status: Offline Points: 207 |
Post Options
Thanks(0)
|
Yes, a resource DLL, from where I load all the other images displayed in XAML. PNG and JPG images are displayed without any problem, only the GIF files don't work from DLL.
|
|
Product: Xtreme ToolkitPro 19.30
Platform: Windows 10 64bit Language: Visual C++ (VS 2019) |
|
agontarenko
Admin Group Joined: 25 March 2016 Status: Offline Points: 299 |
Post Options
Thanks(0)
|
Hello evoX,
Visual Studio doesn't support gif as image resource. You can add gif to resources, and when application will start, unpack gif file to tmp directory and set in XAML this path. <Image Source='file://TMP_DIR\Smiles\3.gif> Regards, Gontarenko Artem |
|
evoX
Senior Member Joined: 25 July 2007 Status: Offline Points: 207 |
Post Options
Thanks(0)
|
Thanks! But why not load to memory and display it in xaml? I think that this is a toolkit pro limitation, not Visual Studio, because PNG images also are custom resources and not a standard VS resource and PNGs are displayed in XAML.
|
|
Product: Xtreme ToolkitPro 19.30
Platform: Windows 10 64bit Language: Visual C++ (VS 2019) |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |