<noframes id="npvbp"><big id="npvbp"><sub id="npvbp"></sub></big>

<big id="npvbp"></big>

        <big id="npvbp"></big>

          <address id="npvbp"><address id="npvbp"><thead id="npvbp"></thead></address></address>

                  <address id="npvbp"><cite id="npvbp"></cite></address>
                  Home ? Source Code ? Image Transformation: Grayscale to Color

                  Image Transformation: Grayscale to Color

                  maninwest
                  2015-02-09 02:49:11
                  The author
                  View(s):
                  Download(s): 0
                  Point (s): 1?
                  Category Category:
                  .NET2.0.NET2.0 C SharpC#

                  Description

                  1].Level) { leftColor = points[points.Count - 1]; } else { for (int j = 0; j < points.Count - 1; j++) { if ((points[j].Level <= i) & (points[j + 1].Level > i)) { leftColor = points[j]; rightColor = points[j + 1]; } } } if ((rightColor.Level - leftColor.Level) != 0) { double koef = (double)(i - leftColor.Level) / (double)(rightColor.Level - leftColor.Level); int r = leftColor.Color.R + (int)(koef * (rightColor.Color.R - leftColor.Color.R)); int g = leftColor.Color.G + (int)(koef * (rightColor.Color.G - leftColor.Color.G)); int b = leftColor.Color.B + (int)(koef * (rightColor.Color.B - leftColor.Color.B)); colors[i] = Color.FromArgb(r, g, b); } else { colors[i] = leftColor.Color; } } return colors; }
                  Now we can get the color image:
                  colorBitmap = new Bitmap(sourceBitmap); for (int i = 0; i < sourceBitmap.Width; i++)
                  { for (int j = 0; j < sourceBitmap.Height; j++)
                      { int level = sourceBitmap.GetPixel(i, j).B; colorBitmap.SetPixel(i, j, colors[level]);
                      }
                  }
                  pbxColorImage.Image = colorBitmap;
                  



                  Sponsored links

                  File list

                  Tips: You can preview the content of files by clicking file names^_^
                  Name Size Date
                  ColorTransformApp.sln941.00 B2009-01-26|08:44
                  ColorTransformApp.suo17.00 kB2009-01-26|09:11
                  01.96 kB
                  01.96 kB
                  01.96 kB
                  ColorTransformApp.exe12.50 kB2009-01-26|09:12
                  ColorTransformApp.vshost.exe13.99 kB2009-01-26|09:13
                  ColorToGrayscle.cs1.76 kB2009-01-26|09:10
                  ColorTransformApp.csproj3.72 kB2009-01-26|09:02
                  MainForm.cs1.50 kB2009-01-26|09:12
                  MainForm.Designer.cs9.13 kB2009-01-26|09:05
                  MainForm.resx6.07 kB2009-01-26|09:05
                  Program.cs512.00 B2009-01-26|08:44
                  01.96 kB
                  AssemblyInfo.cs1.43 kB2009-01-26|08:44
                  Resources.Designer.cs2.80 kB2009-01-26|08:44
                  Resources.resx5.48 kB2009-01-26|08:44
                  Settings.Designer.cs1.08 kB2009-01-26|08:44
                  Settings.settings249.00 B2009-01-26|08:44
                  ...
                  Sponsored links

                  Comments

                  (Add your comment, get 0.1 Point)
                  Minimum:15 words, Maximum:160 words
                  • 1
                  • Page 1
                  • Total 1

                  Image Transformation: Grayscale to Color (27.34 kB)(70.43 kB)

                  Need 1 Point(s)
                  Your Point (s)

                  Your Point isn't enough.

                  Get 22 Point immediately by PayPal

                  Point will be added to your account automatically after the transaction.

                  More(Debit card / Credit card / PayPal Credit / Online Banking)

                  Submit your source codes. Get more Points

                  LOGIN

                  Don't have an account? Register now
                  Need any help?
                  Mail to: support@codeforge.com

                  切換到中文版?

                  CodeForge Chinese Version
                  CodeForge English Version

                  Where are you going?

                  ^_^"Oops ...

                  Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!
                  OK

                  Warm tip!

                  CodeForge to FavoriteFavorite by Ctrl+D
                  <noframes id="npvbp"><big id="npvbp"><sub id="npvbp"></sub></big>

                  <big id="npvbp"></big>

                        <big id="npvbp"></big>

                          <address id="npvbp"><address id="npvbp"><thead id="npvbp"></thead></address></address>

                                  <address id="npvbp"><cite id="npvbp"></cite></address>
                                  喜来乐棋牌