Click here to Skip to main content
15,890,717 members
Home / Discussions / Graphics
   

Graphics

 
QuestionProblem extracting full palette from 8bit image Pin
Sepharo4-Jun-07 7:47
Sepharo4-Jun-07 7:47 
AnswerRe: Problem extracting full palette from 8bit image Pin
Mark Salsbery4-Jun-07 8:05
Mark Salsbery4-Jun-07 8:05 
GeneralRe: Problem extracting full palette from 8bit image Pin
Sepharo4-Jun-07 8:26
Sepharo4-Jun-07 8:26 
GeneralRe: Problem extracting full palette from 8bit image Pin
Mark Salsbery4-Jun-07 8:37
Mark Salsbery4-Jun-07 8:37 
GeneralRe: Problem extracting full palette from 8bit image Pin
Sepharo4-Jun-07 8:41
Sepharo4-Jun-07 8:41 
GeneralRe: Problem extracting full palette from 8bit image Pin
Sepharo4-Jun-07 8:59
Sepharo4-Jun-07 8:59 
GeneralRe: Problem extracting full palette from 8bit image Pin
Mark Salsbery4-Jun-07 9:22
Mark Salsbery4-Jun-07 9:22 
GeneralRe: Problem extracting full palette from 8bit image Pin
Mark Salsbery4-Jun-07 9:16
Mark Salsbery4-Jun-07 9:16 
Hmmm...

Is this managed C++? If so, does optimizing the loop help any?
public static RGBQUAD[] RGBQUADFromColorArray(Bitmap bmp)
{
   // Some programs as Axialis have problems with a reduced palette, so lets create a full palette
   int bits = Tools.BitsFromPixelFormat(bmp.PixelFormat);
 
   if (bits <= 8)
   {
      RGBQUAD[] rgbArray = new RGBQUAD[1 << bits];
 
      ColorPalette ^palette = bmp.Palette;
      array<Color>^palcolors = palette->Entries;
      for(int i=0; i < palcolors->Length; i++)
      {
         rgbArray[i].rgbRed = palcolors[i].R;
         rgbArray[i].rgbGreen= palcolors[i].G;
         rgbArray[i].rgbBlue = palcolors[i].B;
      }
 
      return rgbArray;
   }
 
   return 0;
} 








"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

GeneralRe: Problem extracting full palette from 8bit image Pin
Sepharo4-Jun-07 9:23
Sepharo4-Jun-07 9:23 
GeneralRe: Problem extracting full palette from 8bit image Pin
Mark Salsbery4-Jun-07 9:28
Mark Salsbery4-Jun-07 9:28 
GeneralRe: Problem extracting full palette from 8bit image Pin
Sepharo4-Jun-07 9:40
Sepharo4-Jun-07 9:40 
GeneralRe: Problem extracting full palette from 8bit image Pin
Mark Salsbery4-Jun-07 9:44
Mark Salsbery4-Jun-07 9:44 
GeneralRe: Problem extracting full palette from 8bit image Pin
Mark Salsbery4-Jun-07 9:36
Mark Salsbery4-Jun-07 9:36 
GeneralRe: Problem extracting full palette from 8bit image Pin
Sepharo4-Jun-07 9:42
Sepharo4-Jun-07 9:42 
QuestionWinamp like credits? Pin
Stevie4-Jun-07 1:05
Stevie4-Jun-07 1:05 
QuestionHow to create a dynamic array of direct draw surfaces [modified] Pin
GTaylor552-Jun-07 15:50
GTaylor552-Jun-07 15:50 
AnswerRe: A Workaround solution Pin
GTaylor554-Jun-07 0:33
GTaylor554-Jun-07 0:33 
GeneralRe: A Workaround solution Pin
XTAL2564-Jun-07 2:47
XTAL2564-Jun-07 2:47 
AnswerRe: The Solution Pin
GTaylor5514-Jun-07 0:53
GTaylor5514-Jun-07 0:53 
QuestionBlank Image Detection Pin
JoeGonzalez2-Jun-07 7:24
JoeGonzalez2-Jun-07 7:24 
Questionpbuffers [modified] Pin
XTAL2561-Jun-07 14:59
XTAL2561-Jun-07 14:59 
QuestionNewbie Camera Math Question Pin
joshp12171-Jun-07 9:05
joshp12171-Jun-07 9:05 
QuestionCropping Surrounding White Area Pin
zubair_ahmed31-May-07 20:56
zubair_ahmed31-May-07 20:56 
AnswerRe: Cropping Surrounding White Area Pin
Mark Salsbery1-Jun-07 5:06
Mark Salsbery1-Jun-07 5:06 
AnswerRe: Cropping Surrounding White Area Pin
Ian Shlasko1-Jun-07 7:13
Ian Shlasko1-Jun-07 7:13 

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.