Click here to Skip to main content
15,891,136 members
Home / Discussions / C#
   

C#

 
AnswerRe: Indexer question Pin
e-laj21-Sep-06 6:08
e-laj21-Sep-06 6:08 
AnswerRe: Indexer question Pin
Insincere Dave21-Sep-06 6:24
Insincere Dave21-Sep-06 6:24 
Question"String" and "string" Pin
#realJSOP21-Sep-06 4:40
mve#realJSOP21-Sep-06 4:40 
AnswerRe: "String" and "string" Pin
S. Senthil Kumar21-Sep-06 4:55
S. Senthil Kumar21-Sep-06 4:55 
AnswerRe: "String" and "string" Pin
Judah Gabriel Himango21-Sep-06 4:57
sponsorJudah Gabriel Himango21-Sep-06 4:57 
Questionhow to lock or hide a folder? Pin
svimalraaj21-Sep-06 4:21
svimalraaj21-Sep-06 4:21 
AnswerRe: how to lock or hide a folder? Pin
Le centriste21-Sep-06 5:26
Le centriste21-Sep-06 5:26 
QuestionHow to change the color depth of a bitmap Pin
UrbanSpaceman21-Sep-06 4:07
UrbanSpaceman21-Sep-06 4:07 
Hi all!

Mission: take a bitmap (which is saved on the harddisk), convert it to another, with given size and color depth, and save.

Code:
// load the original bitmap from hard disk
Bitmap originalBmp = new Bitmap( path );
// create a new bitmap with needed size
Bitmap bmp = new Bitmap( originalBmp, new Size( 32, 32 ) );
// find the codec for saving ("GetCodecInfo" browses all known codecs and
// finds the needed one; it works fine)
ImageCodecInfo codec = GetCodecInfo( "image/bmp" );
EncoderParameters parameters = new EncoderParameters( 1 );
// set the color depth
parameters.Param[0] = new EncoderParameter( Encoder.ColorDepth, 8L );
// save the bitmap
bmp.Save( path, codec, parameters );

Problem: no matter what i do, the color depth of the resulting bitmap is always "truecolor" (i.e., 24 bpp). What am i doing wrong? I've seen very similar samples on MSDN, where MS claim that this is the way to control the color depth. But it doesn't work!

Thanks!

Gal S.
QuestionHow can i use winmm.dll to adjust the master volume of Windows Pin
Kariem Soudy21-Sep-06 4:00
Kariem Soudy21-Sep-06 4:00 
AnswerRe: How can i use winmm.dll to adjust the master volume of Windows Pin
Judah Gabriel Himango21-Sep-06 5:06
sponsorJudah Gabriel Himango21-Sep-06 5:06 
QuestionHelp with updating/replacing a Bitmap in a Resource Pin
gold.mine21-Sep-06 3:55
gold.mine21-Sep-06 3:55 
QuestionCan I rename the ProcessName of a program Pin
Cybercockroach21-Sep-06 3:42
Cybercockroach21-Sep-06 3:42 
AnswerRe: Can I rename the ProcessName of a program Pin
Ed.Poore21-Sep-06 4:11
Ed.Poore21-Sep-06 4:11 
AnswerRe: Can I rename the ProcessName of a program Pin
Judah Gabriel Himango21-Sep-06 5:04
sponsorJudah Gabriel Himango21-Sep-06 5:04 
GeneralRe: Can I rename the ProcessName of a program Pin
Cybercockroach22-Sep-06 5:03
Cybercockroach22-Sep-06 5:03 
QuestionGetting list view item information Pin
Hampus@foi21-Sep-06 3:27
Hampus@foi21-Sep-06 3:27 
AnswerRe: Getting list view item information Pin
Ed.Poore21-Sep-06 4:09
Ed.Poore21-Sep-06 4:09 
QuestionInteraction with a C# program Pin
Lapius21-Sep-06 3:17
Lapius21-Sep-06 3:17 
AnswerRe: Interaction with a C# program Pin
Ed.Poore21-Sep-06 4:08
Ed.Poore21-Sep-06 4:08 
AnswerRe: Interaction with a C# program Pin
Andrei Ungureanu21-Sep-06 5:02
Andrei Ungureanu21-Sep-06 5:02 
AnswerRe: Interaction with a C# program Pin
Jun Du21-Sep-06 5:26
Jun Du21-Sep-06 5:26 
Questionreturning more than 1 value from a function Pin
saqib8221-Sep-06 3:09
saqib8221-Sep-06 3:09 
AnswerRe: returning more than 1 value from a function Pin
mikone21-Sep-06 3:13
mikone21-Sep-06 3:13 
GeneralRe: returning more than 1 value from a function Pin
saqib8221-Sep-06 20:42
saqib8221-Sep-06 20:42 
AnswerRe: returning more than 1 value from a function Pin
Martin#21-Sep-06 3:46
Martin#21-Sep-06 3:46 

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.