B
Bubbles Van
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
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