Page 1 of 1

Need help animating a .ani cursor

Posted: Thu Aug 23, 2012 1:04 pm
by papayrus
When I load a .ani for a cursor it loads but does not animate at all. This is the code I made for it.

Code: Select all

wxImage image4(wxT("Ani\\Arrow.ani"), wxBITMAP_TYPE_ANI);
if (image4.Ok())
wxCursor cursor4(image4);
TextCtrl4->SetCursor(wxCursor(image4));

Re: Need help animating a .ani cursor

Posted: Thu Aug 23, 2012 1:08 pm
by doublemax
I think wxAnimation is the only class that supports animations, I'm almost sure that any other conversion will lose the animation information.

Re: Need help animating a .ani cursor

Posted: Thu Aug 23, 2012 8:20 pm
by papayrus
I tried that but will that load .ani files and also will it auto play or do I need to ->Play it because I tried this and it did not work either but I will try again and see if I did something wrong.

EDIT it works just loading it like this but how can I set it to the cursor?

Code: Select all

m_animationCtrl = new wxAnimationCtrl(this, wxID_ANY);
    if (m_animationCtrl->LoadFile(wxT("Arrow.ani")))
        m_animationCtrl->Play();

Re: Need help animating a .ani cursor

Posted: Thu Aug 23, 2012 9:51 pm
by doublemax
I don't think wxWidgets supports animated cursors. Looking at the MSW source codes, it *might* work if you explicitly load a native Windows cursor, but i'm not sure and haven't tried it.

Re: Need help animating a .ani cursor

Posted: Fri Aug 24, 2012 3:58 am
by papayrus
Yes I already loaded a native windows cursor and it loads and animates but it will not animate any of my custom cursors. Oh well if it does not support it then I guess there is not anything I can do. Thanks alot for the info.
I just think it is kind of weird though that it supports .ani files but just does not animate them.