Click here to Skip to main content
16,011,868 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to create resizable controls Pin
Rajasekharan Vengalil9-Nov-07 20:19
Rajasekharan Vengalil9-Nov-07 20:19 
GeneralRe: How to create resizable controls Pin
A.Asif9-Nov-07 20:43
A.Asif9-Nov-07 20:43 
GeneralRe: How to create resizable controls Pin
Christian Graus9-Nov-07 23:00
protectorChristian Graus9-Nov-07 23:00 
AnswerRe: How to create resizable controls Pin
dtr19-Nov-07 20:20
dtr19-Nov-07 20:20 
QuestionUsing Bitwise operations, z-ordering Pin
kkooring9-Nov-07 19:11
kkooring9-Nov-07 19:11 
AnswerRe: Using Bitwise operations, z-ordering Pin
Christian Graus9-Nov-07 19:20
protectorChristian Graus9-Nov-07 19:20 
QuestionIcon Pin
MasterSharp9-Nov-07 15:33
MasterSharp9-Nov-07 15:33 
AnswerRe: Icon Pin
Luc Pattyn9-Nov-07 16:17
sitebuilderLuc Pattyn9-Nov-07 16:17 
Hi,

the way I often do it is by creating a normal image, then programmatically converting
it to a simple icon:

/// <summary>
/// Converts an image file (e.g. 32*32 pixel JPEG) to an icon file
/// </summary>
/// <param name="filename"></param>
public void ImageToIcon(string filename) {
    Bitmap bm=new Bitmap(filename);
    Icon icon=Icon.FromHandle(bm.GetHicon());
    filename=Path.ChangeExtension(filename, ".ico");
    Stream stream=new FileStream(filename, FileMode.Create);
    icon.Save(stream);
}


Warning: this does not take care of transparency; I guess other image formats such as
PNG are needed if transparency is relevant.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]


this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google


GeneralRe: Icon Pin
MasterSharp9-Nov-07 17:07
MasterSharp9-Nov-07 17:07 
GeneralRe: Icon Pin
Luc Pattyn9-Nov-07 17:18
sitebuilderLuc Pattyn9-Nov-07 17:18 
GeneralRe: Icon Pin
MasterSharp9-Nov-07 17:42
MasterSharp9-Nov-07 17:42 
GeneralRe: Icon Pin
MasterSharp9-Nov-07 17:43
MasterSharp9-Nov-07 17:43 
GeneralRe: Icon Pin
MasterSharp9-Nov-07 17:50
MasterSharp9-Nov-07 17:50 
GeneralRe: Icon Pin
Luc Pattyn9-Nov-07 18:25
sitebuilderLuc Pattyn9-Nov-07 18:25 
GeneralRe: Icon Pin
Rajasekharan Vengalil9-Nov-07 20:27
Rajasekharan Vengalil9-Nov-07 20:27 
GeneralRe: Icon Pin
MasterSharp10-Nov-07 3:58
MasterSharp10-Nov-07 3:58 
GeneralRe: Icon Pin
Rajasekharan Vengalil10-Nov-07 6:16
Rajasekharan Vengalil10-Nov-07 6:16 
Questionuser control Pin
nhathoang9-Nov-07 13:27
nhathoang9-Nov-07 13:27 
AnswerRe: user control Pin
mav.northwind9-Nov-07 20:30
mav.northwind9-Nov-07 20:30 
AnswerDouble post Pin
pmarfleet9-Nov-07 21:43
pmarfleet9-Nov-07 21:43 
QuestionIE7 Clearing cache before using a WebRequest to get data ? Pin
BillWoodruff9-Nov-07 12:59
professionalBillWoodruff9-Nov-07 12:59 
AnswerRe: IE7 Clearing cache before using a WebRequest to get data ? Pin
Rajasekharan Vengalil9-Nov-07 20:37
Rajasekharan Vengalil9-Nov-07 20:37 
GeneralRe: IE7 Clearing cache before using a WebRequest to get data ? Pin
BillWoodruff11-Nov-07 14:47
professionalBillWoodruff11-Nov-07 14:47 
QuestionSomething SImple Pin
MasterSharp9-Nov-07 10:48
MasterSharp9-Nov-07 10:48 
AnswerRe: Something SImple Pin
Judah Gabriel Himango9-Nov-07 10:58
sponsorJudah Gabriel Himango9-Nov-07 10:58 

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.