I found a class to help me build gif animation. However, some of the code takes a long time to exicute large images. In the code is suggest a "non-safe" method should be implimented to make it faster. I'm a VB coder and no nothing about c#.
Can anyone help me make this faster.

C# Code:
  1. /**
  2.          * Extracts image pixels into byte array "pixels"
  3.          */
  4.         protected void GetImagePixels()
  5.         {
  6.             int w = image.Width;
  7.             int h = image.Height;
  8.             //      int type = image.GetType().;
  9.             if ((w != width)
  10.                 || (h != height)
  11.                 )
  12.             {
  13.                 // create new image with right size/format
  14.                 Image temp =
  15.                     new Bitmap(width, height );
  16.                 Graphics g = Graphics.FromImage( temp );
  17.                 g.DrawImage(image, 0, 0);
  18.                 image = temp;
  19.                 g.Dispose();
  20.             }
  21.             /*
  22.                 ToDo:
  23.                 improve performance: use unsafe code
  24.             */
  25.             pixels = GetPixels(image);
  26.             return
  27.             pixels = new Byte [ 3 * image.Width * image.Height ];
  28.             int count = 0;
  29.             Bitmap tempBitmap = new Bitmap( image );
  30.             for (int th = 0; th < image.Height; th++)
  31.             {
  32.                 for (int tw = 0; tw < image.Width; tw++)
  33.                 {
  34.                     Color color = tempBitmap.GetPixel(tw, th);
  35.                     pixels[count] = color.R;
  36.                     count++;
  37.                     pixels[count] = color.G;
  38.                     count++;
  39.                     pixels[count] = color.B;
  40.                     count++;
  41.                 }
  42.             }