Reputation: 53
I am trying to create an icon from a stream like this for example:
System.IO.Stream iconStream = Application.GetResourceStream(new Uri("pack://application:,,,/YourReferencedAssembly;component/YourPossibleSubFolder/YourResourceFile.ico")).Stream;
Then when I try to assign it like this it has no notion of Icon inside Drawing, I tried adding the reference and still nothing:
tbi.Icon = new System.Drawing.Icon(iconStream);
Having this at the top:
using System.Drawing;
Here's the error:
Error 1 The type or namespace name 'Icon' does not exist in the namespace 'System.Drawing' (are you missing an assembly reference?)
Its really puzzling to me, I'd appreciate any ideas on what simple thing I must have forgot to add.
Upvotes: 5
Views: 4075
Reputation: 599
It's likely that your project isn't referencing that assembly.
To fix it:
I'm hoping that should take care of it
Upvotes: 5