473,326 Members | 2,173 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,326 software developers and data experts.

How to create an Icon object with multiple images by GDI++ .

Hello ,
Please teach me how to create an Icon object with multiple images by GDI++ .
I can create an Icon with a image as following , but can't do an Icon with
multiple images.

private Icon ReturnIcon()
{
Bitmap Cbitmap = new Bitmap(32, 32, PixelFormat.Format64bppPArgb);
Graphics gc = Graphics.FromImage(Cbitmap);
//
//draw something on Cbitmap.
//
gc.Dispose();
Cbitmap.MakeTransparent(Color.White);
System.IntPtr icH = Cbitmap.GetHicon();
Icon ico = Icon.FromHandle(icH);
Cbitmap.Dispose();
return ico;
}

Nov 16 '05 #1
2 4477
You might want to read this article:
http://www.codeproject.com/dotnet/MultiIcon.asp

-- Ricky Lee
==================================================
^o^ "When all doors are closed, God will open a Windows" ^o^
==================================================
"Netian" <Ne****@sample.com> wrote in message
news:uz*************@TK2MSFTNGP10.phx.gbl...
Hello ,
Please teach me how to create an Icon object with multiple images by GDI++ .. I can create an Icon with a image as following , but can't do an Icon with
multiple images.

private Icon ReturnIcon()
{
Bitmap Cbitmap = new Bitmap(32, 32, PixelFormat.Format64bppPArgb);
Graphics gc = Graphics.FromImage(Cbitmap);
//
//draw something on Cbitmap.
//
gc.Dispose();
Cbitmap.MakeTransparent(Color.White);
System.IntPtr icH = Cbitmap.GetHicon();
Icon ico = Icon.FromHandle(icH);
Cbitmap.Dispose();
return ico;
}

Nov 16 '05 #2
Mr. Ricky Lee ,
Thank you for your kindness !!
This issue should certainly be settled by your advice soon.

Really, I knew '^o^ "When all doors are closed, God will open a Windows"
^o^'.

"Ricky Lee" <de****@benzine.com> wrote in message
news:42***********************@news.wanadoo.nl...
You might want to read this article:
http://www.codeproject.com/dotnet/MultiIcon.asp

-- Ricky Lee
==================================================
^o^ "When all doors are closed, God will open a Windows" ^o^
==================================================
"Netian" <Ne****@sample.com> wrote in message
news:uz*************@TK2MSFTNGP10.phx.gbl...
Hello ,
Please teach me how to create an Icon object with multiple images by
GDI++

.
I can create an Icon with a image as following , but can't do an Icon
with
multiple images.

private Icon ReturnIcon()
{
Bitmap Cbitmap = new Bitmap(32, 32, PixelFormat.Format64bppPArgb);
Graphics gc = Graphics.FromImage(Cbitmap);
//
//draw something on Cbitmap.
//
gc.Dispose();
Cbitmap.MakeTransparent(Color.White);
System.IntPtr icH = Cbitmap.GetHicon();
Icon ico = Icon.FromHandle(icH);
Cbitmap.Dispose();
return ico;
}



Nov 16 '05 #3

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

Similar topics

4
by: Terry | last post by:
There are a number of things about using unmanaged resources in Windows Forms programming that is unclear to me. In C++, if you loaded an icon resource using "ExtractIcon()", the resource was...
4
by: Arda Coskun | last post by:
Hi, How to create embedded graphics and audios? Any article would be helpful. Kind regards,
5
by: Fei Li | last post by:
3
by: Ravi Shankar | last post by:
Hi, I have a windows form application it uses AxShDocVw AxWebBrowser control. The control navigates to web pages at a specified interval set in Timer control. The form uses a notify icon. On...
3
by: Richard Skopal | last post by:
In .NET Windows forms I can create a metafile using this code: Graphics grph = aControl.CreateGraphics(); IntPtr ipHDC = grph.GetHdc(); Metafile mf = new Metafile(aImgFilePath, ipHDC,...
3
by: Giuseppe Pezzella | last post by:
Hi In Windows every file have yours icon, so: how I get them ( Extension and Icon) and save in a imageList for use later in a ListView? In VB6 was SHGetFileInfo. In VB.NET? How I can...
4
by: Pawel | last post by:
Hello I've a problem with DataGrid and Icon. Incons are in DataGrid's cells next to the other data. And now. When i cklick this icon i want to change icon without reload site. How to do this?...
4
by: =?Utf-8?B?dmluZWV0?= | last post by:
In WPF (even with considerable improvement in version 3.5), while running multiple animations in a single window, The performance of one animation suffers a lot. for example, i have two image...
7
by: =?Utf-8?B?QmVu?= | last post by:
Hi I am looking for a way to extraxt an icon from a .exe file an save it as an icon not a bitmap or jpeg to a file? The code below extracts the icon but only as a bitmap PictureBox1.Image =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.