How to convert a Bitmap to Icon at code level?


Author
Message
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
...

Crying

StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Nah, the beta only lasted for 3 weeks... they took it offline back on June 10th... As for the game itself, it will be out on Sept. 25th (at least here in the states).  Not sure about the distribution down in Brazil, but if you have an Xbox 360 with the right region coding, you can play games from the US.
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Oh, yeah, I racked up about 140 games on the 3 weeks that it was running... only played enough games to make Lieutenant, but I did have a kill/death ratio of about 2.3... something like 2300 kills and 900 deaths.  They took down the online stats so I don't remember what they were exactly. 

w00t  totally speechless

Is it possible to get it and play it over here?

StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Have you played the Halo3 beta?

Oh, yeah, I racked up about 140 games on the 3 weeks that it was running... only played enough games to make Lieutenant, but I did have a kill/death ratio of about 2.3... something like 2300 kills and 900 deaths.  They took down the online stats so I don't remember what they were exactly. 

Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hey Ben.

Have you played the Halo3 beta?

StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Check out the trailers for Crysis http://www.crysis-online.com/

Oh, yeah, that is going to be a beautiful game.  The guys over at Kotaku.com said they got a pretty good hands on at E3 last week and said that no only are the graphics and engine beautiful, but the gameplay is really going to shine as well.  For right now, though, I'd have to honestly say that I think I'm more interested in Halo 3 (duh...) and Mass Effect (masseffect.bioware.com) which is going to be just phenominal.

Paul Chase
Paul Chase
Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
Thanks Ben !

I wanted to make sure there was no gotcha that I didn't know about! Smile

Check out the trailers for Crysis http://www.crysis-online.com/

StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
GetHIcon()

Nice, one Paul... I always forget about that one.

Why do you prefer embedding vs adding as a resource?

Well, they're essentiall the same thing... when you add it as a resource, it gets added to the .resx file, which itself is embedded.  Pretty much the same difference.

But the main reason I mentioned embedding is that for some reason, I was thinking that when you added icons to the project resources (or any other resx file), they were added as images.  However, I now see that there are separate categories for Images and Icons... so, I stand corrected Smile

So, for Ben H, it probably would be easier to add the icon as an ICO file to the Icons of your resources and just retrieve it through the default resource manager since it will create the strong-typed property for it.

Ben Hayat
Ben Hayat
Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)
Group: Forum Members
Posts: 374, Visits: 1.2K
Paul Chase (07/13/2007)
Ben H,



Here is how to accomplish what you originally asked in VB,For C# you would probably just have to change the casting.



NotifyIcon1.Icon = System.Drawing.Icon.FromHandle(CType(Me.ImageList1.Images(0), Drawing.Bitmap).GetHicon)



Ben C,



Why do you prefer embedding vs adding as a resource?



Paul




Paul, thank you very much for your contribution. I went ahead and did it in C# and works great.

If you don't mind, I'll post your solution along side Ben's in the sample area.



Once again, Thanks!

..ßen
Paul Chase
Paul Chase
Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
Ben H,

Here is how to accomplish what you originally asked in VB, For C# you would probably just have to change the casting.

 NotifyIcon1.Icon = System.Drawing.Icon.FromHandle(CType(Me.ImageList1.Images(0), Drawing.Bitmap).GetHicon)

Ben C ,

Why do you prefer embedding vs adding as a resource?

Paul


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search