Click here to Skip to main content
15,916,842 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
Question.ico to .cur conversion in stream object Pin
p_s_i_2007073029-Jul-07 23:11
p_s_i_2007073029-Jul-07 23:11 
AnswerRe: .ico to .cur conversion in stream object Pin
Dave Kreskowiak30-Jul-07 9:28
mveDave Kreskowiak30-Jul-07 9:28 
GeneralRe: .ico to .cur conversion in stream object Pin
p_s_i_2007073030-Jul-07 19:58
p_s_i_2007073030-Jul-07 19:58 
GeneralRe: .ico to .cur conversion in stream object Pin
p_s_i_2007073031-Jul-07 0:46
p_s_i_2007073031-Jul-07 0:46 
GeneralRe: .ico to .cur conversion in stream object Pin
Luc Pattyn31-Jul-07 1:20
sitebuilderLuc Pattyn31-Jul-07 1:20 
GeneralRe: .ico to .cur conversion in stream object Pin
p_s_i_2007073031-Jul-07 1:58
p_s_i_2007073031-Jul-07 1:58 
GeneralRe: .ico to .cur conversion in stream object Pin
Luc Pattyn31-Jul-07 2:09
sitebuilderLuc Pattyn31-Jul-07 2:09 
GeneralRe: .ico to .cur conversion in stream object Pin
Dave Kreskowiak31-Jul-07 2:56
mveDave Kreskowiak31-Jul-07 2:56 
The point your missing is that the data expected by the Stream constructor requires that it contains certion information and is formmated exactly how it expects as a stream of bytes. The data you're giving this constructor is not formatted for a cursor file and is not in the proper format. You simply cannot use the Stream constructor how you want.

You have to build an array of bytes, or write to a MemoryStream and write the data from the .ico file, massaged and reformatted for the .cur format. You must also place the bytes describing the click hotspot into this array in the place that the .cur file format expects. THen you can pass the MemoryStream to the Stream constructor of the Cursor class.

In order to do what you want, you have to be familiar with the file formats of both .ico and .cur files, down to the byte.


A guide to posting questions on CodeProject[^]

Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


GeneralRe: .ico to .cur conversion in stream object Pin
Luc Pattyn31-Jul-07 3:48
sitebuilderLuc Pattyn31-Jul-07 3:48 
GeneralRe: .ico to .cur conversion in stream object Pin
Dave Kreskowiak31-Jul-07 4:33
mveDave Kreskowiak31-Jul-07 4:33 
GeneralRe: .ico to .cur conversion in stream object Pin
p_s_i_2007073031-Jul-07 4:00
p_s_i_2007073031-Jul-07 4:00 
GeneralRe: .ico to .cur conversion in stream object Pin
Dave Kreskowiak31-Jul-07 4:34
mveDave Kreskowiak31-Jul-07 4:34 
AnswerRe: .ico to .cur conversion in stream object Pin
Vasudevan Deepak Kumar30-Jul-07 18:42
Vasudevan Deepak Kumar30-Jul-07 18:42 
Questionicon to cursor conversion Pin
p_s_i_2007073029-Jul-07 22:12
p_s_i_2007073029-Jul-07 22:12 
AnswerRe: icon to cursor conversion Pin
JoeSharp29-Jul-07 22:58
JoeSharp29-Jul-07 22:58 
QuestionHow to Select a Node in a TreeView Control Pin
bneacetp29-Jul-07 18:56
bneacetp29-Jul-07 18:56 
Questionhow to create project in Asp.net Pin
purvi barot27-Jul-07 22:48
purvi barot27-Jul-07 22:48 
AnswerRe: how to create project in Asp.net Pin
Paul Conrad29-Jul-07 19:49
professionalPaul Conrad29-Jul-07 19:49 
GeneralRe: how to create project in Asp.net Pin
purvi barot31-Jul-07 6:26
purvi barot31-Jul-07 6:26 
AnswerRe: how to create project in Asp.net Pin
koolprasad200331-Jul-07 2:00
professionalkoolprasad200331-Jul-07 2:00 
QuestionSEHException and FolderBrowseDialog Pin
SamM27-Jul-07 10:23
SamM27-Jul-07 10:23 
QuestionWinForms vs. WPF for enterprise development Pin
jsaindon27-Jul-07 6:59
jsaindon27-Jul-07 6:59 
AnswerRe: WinForms vs. WPF for enterprise development Pin
ne0h27-Jul-07 7:46
ne0h27-Jul-07 7:46 
GeneralRe: WinForms vs. WPF for enterprise development Pin
Paul Conrad27-Jul-07 19:53
professionalPaul Conrad27-Jul-07 19:53 
AnswerRe: WinForms vs. WPF for enterprise development Pin
Paul Conrad27-Jul-07 19:52
professionalPaul Conrad27-Jul-07 19:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.