IT Community - Software Programming, Web Development and Technical Support

How to convert 8-bit bitmap to 24-bit bitmap?

This is a discussion on How to convert 8-bit bitmap to 24-bit bitmap? within the C# Programming forums, part of the Software Development category; How to convert 8-bit bitmap to 24-bit bitmap?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C# Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-18-2007, 10:47 PM
theone theone is offline
D-Web Sr.Programmer
 
Join Date: Jun 2007
Posts: 129
theone is on a distinguished road
Question How to convert 8-bit bitmap to 24-bit bitmap?

How to convert 8-bit bitmap to 24-bit bitmap?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-19-2007, 12:58 AM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 633
oxygen is on a distinguished road
Default Re: How to convert 8-bit bitmap to 24-bit bitmap?

Hi, here is the answer for it..

To convert 8-bit to 24-bit image, one way is to draw another bitmap based on original bitmap's pixel color:

Bitmap image = new Bitmap(@"C:\bit8.bmp");
Bitmap bitmap = new Bitmap(image.Width, image.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb) ;
for (int i = 0; i < image.Width; i++)
{
for (int j = 0; j < image.Height; j++)
{
Color temp = image.GetPixel(i, j);
bitmap.SetPixel(i, j, temp);
}
}
bitmap.Save(@"C:\bit24.bmp", System.Drawing.Imaging.ImageFormat.Bmp);
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert YUV to RGB kingmaker C# Programming 2 02-17-2008 12:07 AM
Bitmap checkpoint saved itbarota Testing Tools 1 08-17-2007 03:50 AM
Bitmap checkpoints Shanthi Testing Tools 1 08-10-2007 06:08 AM
How to convert 8-bit bitmap to 24-bit bitmap? theone Mobile Software Development 1 07-30-2007 03:46 AM
Can anyone know a Simple method to convert a bitmap to icon using c# dot net? Archer C# Programming 1 07-22-2007 11:31 PM


All times are GMT -7. The time now is 04:40 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0