473,378 Members | 1,436 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,378 software developers and data experts.

How to save a 32 bit icon to a file

Hi, I've got a 32 bit icon stored in an instance of the System.Drawing.Icon
class.

I've tried to save it with:

FileStream os = new FileStream(saveIconPath,FileMode.CreateNew);
icon.Save(os);
os.Close();

But the colors of the saved icon are messed up.

I'm sure that the icon instance is correct, because if I display it in a
picture box, like this:
pictureBox1.Image=icon.ToBitmap();
it displays correctly.
Nov 16 '05 #1
0 3538

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

Similar topics

2
by: mboyda | last post by:
I have a block of code that useses outputstream to save a pdf to a client computer. It prompts the user with the save dialog, works great but the response finishes after the download completes. ...
3
by: Jo Franklin | last post by:
I am using icon.save to save icon files I've extracted using ExtractIconEx. when I save the large icon everything is fine, but when I save the small icon it looks distorted, and has a black (not...
5
by: Dennis | last post by:
I give up...I have tried all combinations that I can think of and I can't get a bitmap converted to an icon and save it in a filestream or stream; Any help would be appreciated. -- Dennis in...
3
by: SveinErik | last post by:
Hi, I'm trying to find a method to save bmp, jpg and png files as ico files, 16x16 size. I have managed to convert and save bmp files to icon, but only in 32x32 size. I can't figure out how to save...
4
by: Frank | last post by:
Private Sub SaveBitmap(ByVal fileName As String, ByVal p As System.Drawing.Bitmap) ...snip p.Save(fileName, Imaging.ImageFormat.Icon) Does not produce an icon formatted file. At least if I...
2
by: Karl | last post by:
Using A2000 When I click the save icon in form design, Access closes immediately. No warning messges, nothing. This happens on only one form. I deleted the form and recreated it. I could save...
6
scubak1w1
by: scubak1w1 | last post by:
Hello, I have been Googling for a bit now as to how to let the user save the current page via a 'clickable icon' to an HTML file (i.e., on the client side.) That is, I am presenting a lot of...
0
Computer Guru
by: Computer Guru | last post by:
On Error Resume Next Dim SaveFileDialog As New SaveFileDialog SaveFileDialog.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyDocuments ...
0
by: ericstein81 | last post by:
Hey guys, I have a program that creates text files (*.txt) on a user's computer. I was wondering if anyone knew how to save another icon file other than the normail .txt file icon. That way the...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.