Need help animating a .ani cursor Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
papayrus
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 204
Joined: Tue Jan 25, 2011 4:55 pm
Location: USA

Need help animating a .ani cursor

Post 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));
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Need help animating a .ani cursor

Post 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.
Use the source, Luke!
papayrus
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 204
Joined: Tue Jan 25, 2011 4:55 pm
Location: USA

Re: Need help animating a .ani cursor

Post 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();
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Need help animating a .ani cursor

Post 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.
Use the source, Luke!
papayrus
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 204
Joined: Tue Jan 25, 2011 4:55 pm
Location: USA

Re: Need help animating a .ani cursor

Post 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.
Post Reply