473,398 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Loading animated cursor resource

I'm trying to load an animated cursor resource directly from the exe file.
I have added it in into the assembly and set it's build action to embedded
resource.

I have a function written as follows:

Private Function GetResCursor(ByVal strIdentifier As String) As Cursor
Return New
Cursor([Assembly].GetExecutingAssembly().GetManifestResourceStream( strIdenti
fier))
End Function

When I call the function with the following:
m_BusyCursor = GetResCursor("FileSearch.cross.cur")
everything works just fine and I'm able to change the cursor.

However, when I call GetResCursor with this:
m_BusyCursor = GetResCursor("FileSearch.busy.ani")
and specify an animated cursor, I receive the following exception:

An unhandled exception of type 'System.ArgumentException' occurred
in system.windows.forms.dll
Additional information: Invalid image format. The image file may be
corrupt.

I know the image isn't corrupt as I'm able to use this animated cursor file
under mouse properties.

Any suggestions???

Thanks

Brant
Nov 20 '05 #1
2 3873
"Bubbles Van" <bu***************@hotmail.com> schrieb
However, when I call GetResCursor with this:
m_BusyCursor = GetResCursor("FileSearch.busy.ani")
and specify an animated cursor, I receive the following exception:

An unhandled exception of type 'System.ArgumentException'
occurred
in system.windows.forms.dll
Additional information: Invalid image format. The image file
may be
corrupt.


See the docs for the Cursor class. Animated cursors are not supported.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
* "Bubbles Van" <bu***************@hotmail.com> scripsit:
I'm trying to load an animated cursor resource directly from the exe file.
I have added it in into the assembly and set it's build action to embedded
resource.


Maybe this article helps:

<http://vbaccelerator.com/article.asp?id=4565>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Abdessamad Belangour | last post by:
Hi all, I want to display an animated cursor associated to the cursor property of a control. but the animated cursors (.ani files) are not supported by the Cursor class. Is there any other way to...
0
by: Joe | last post by:
I want to display a loading image which is an animated gif but it doesn't move until the control is done loading. Is there anyway to do something like this?
4
by: MrPickwick | last post by:
Hi there. If I place a picturebox on my form and load (at design time) an animated gif into it, it shows and animates allright. If I load my animated gifs in an Imagelist at design time and at...
4
by: Schorschi | last post by:
I am trying to mimic the following (which works) but Use the stock GetManifestResourceStream route. For example Public Declare Unicode Function LoadCursorFromFile Lib "USER32.DLL" Alias...
5
by: Paul Cheetham | last post by:
Hi, I have some custom colour cursors which I have added to my c# project, and set them to be compiled as "Embedded Resource" It seems impossible to load a colour cursor using the standard...
3
by: bdog4 | last post by:
I've seen on some php forums that they use some type of popup box that I assume is javascript to display a animated gif/flash when you do a quick edit. My popup blocker does not detect it so I...
2
by: Dom | last post by:
I need to change the cursor when the mouse is hovering over certain cells in a DataViewGrid, as a visual aid for the user. But the cursor is not something found in the Cursors Class. I have a...
0
by: helraizer1 | last post by:
Hey, I have a PHP script that I made for an image based shoutbox with emoticons. The problem is that php GD doesn't support animated gifs, yet perl GD does. How would I make it so that I could...
3
OuTCasT
by: OuTCasT | last post by:
Hi Guys I would like to use a preloader to load my .aspx page. Just for activity on the page so the users see that something is actually happening. I have a animated .gif loading image. I read...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.