Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Animated GIF in XAML not showing
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Animated GIF in XAML not showing

 Post Reply Post Reply
Author
Message
evoX View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 July 2007
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote evoX Quote  Post ReplyReply Direct Link To This Post Topic: Animated GIF in XAML not showing
    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)
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 12 October 2016 at 4:28am
Hello evoX,

You can explore our sample Samples\Utilities\MarkupPad,  load file Markups\Smiles.xaml
<Image Source='file://Markups\Smiles\3.gif'

Regards,
 Oleksandr Lebed
Back to Top
evoX View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 July 2007
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote evoX Quote  Post ReplyReply Direct Link To This Post Posted: 13 October 2016 at 10:05am
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)
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 13 October 2016 at 10:12am
Oh, you mean that necessary picture is in some DLL..
Back to Top
evoX View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 July 2007
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote evoX Quote  Post ReplyReply Direct Link To This Post Posted: 14 October 2016 at 10:44am
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)
Back to Top
agontarenko View Drop Down
Admin Group
Admin Group


Joined: 25 March 2016
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote agontarenko Quote  Post ReplyReply Direct Link To This Post Posted: 09 November 2016 at 6:35am
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
Back to Top
evoX View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 July 2007
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote evoX Quote  Post ReplyReply Direct Link To This Post Posted: 26 November 2016 at 7:06am
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)
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.