Click to See Complete Forum and Search --> : How to display windows-animated-cursor (ani file)?
indra.settyo
November 21st, 2005, 03:02 AM
Hi everyone!
I want to display/draw/animate (not as a cursor) more than one windows-animated-cursor (ani file) at the same time. Can anyone show me sample windows api/directx api code to displaying/drawing windows-animated-cursor?
E.g. draw ani cursor in child-window/desktop area.
Is it posible to draw ani file as animation without manual drawing (not use FOURCC)?
Thanks.
golanshahar
November 21st, 2005, 03:31 AM
Hi everyone!
I want to display more than one windows-animated-cursor (ani file) at the samte time. Can anyone show me sample windows api/directx api code to displaying/drawing windows-animated-cursor?
Thanks.
Displaying Animated Cursors from a Resource File (http://www.codeguru.com/Cpp/misc/misc/mouseandcursorhandling/article.php/c311/)
Cheers
indra.settyo
November 21st, 2005, 07:55 PM
Thanks a lot for your suggestion golanshahar, but i mean sample code to display/draw/animate ani file not as a cursor (e.g draw ani cursor in child-window/desktop area). Is it posible without manual drawing (e.g. not use FOURCC)? Any suggestion? I wait for your suggestion.
Thanks.
Boris K K
November 22nd, 2005, 07:45 AM
Use a static control with style SS_ICON and
SendDlgItemMessage(hDlg, IDC_STATICn, STM_SETIMAGE, IMAGE_CURSOR, (LPARAM) hCursor);
indra.settyo
November 22nd, 2005, 08:14 PM
Use a static control with style SS_ICON and
SendDlgItemMessage(hDlg, IDC_STATICn, STM_SETIMAGE, IMAGE_CURSOR, (LPARAM) hCursor);
Thanks to Boris K K. But how to animate/draw in another control e.g. button, listview?
Boris K K
November 28th, 2005, 06:59 AM
How you animate a part of a standard Windows control may vary depending on the type of the control. But in all cases you will have to create a timer, which will define the frame change rate.
Button: You can either use BS_BITMAP and send BM_SETIMAGE to change the frame being displayed or BS_OWNERDRAW and invalidate a part of the button (or the whole button) whenever a new frame needs to be shown. Naturally, in the second case the code that implements the drawing must be aware of the index of the frame that should be displayed next.
List view: Again there are at least two possibilities - create an image list, which contains all frames from the cursor animation and use TVM_SETITEM with TVIF_IMAGE flag or handle NM_CUSTOMDRAW for the animated item.
You can draw a specific frame from the cursor animation using DrawIconEx API function. However for obtaining the frame rate, custom delays for each frame and custom sequence of frames (those are all features of the .ani file), you will have to read and interpret the .ani file yourself (possibly with a little help from Multi-medai I/O API).
indra.settyo
December 2nd, 2005, 04:56 AM
http://www.fourcc.org/fccovrly.php
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.