Palette Color Not Changed

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • krishnasamy
    New Member
    • Jun 2007
    • 31

    Palette Color Not Changed

    Hi,

    I have writing the code for change the Palette color of the Bitmap. But I didn't get any different between given image and result image.

    Here I given my code,


    Bitmap *bmp=new Bitmap(L"skumar 3.bmp");
    INT size = bmp->GetPaletteSize ();// bitmap->GetPaletteSize ();
    printf("The size of the palette is %d bytes.\n", size);
    ColorPalette* palette = (ColorPalette*) malloc(size);

    bmp->GetPalette(pal ette, size);

    for (int index = 0; index < 255; index++)
    {

    palette->Entries[index]= Color::MakeARGB (255,index ,index ,index );

    }


    bmp->SetPalette(pal ette);
    bmp->Save(L"skumar4 .bmp", &guidBmp);

    Please Help me to solve this problem.
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    Which library are you using?

    I'm not sure, but is the Palate just the color with which you have available if you were to draw something?

    Comment

    • krishnasamy
      New Member
      • Jun 2007
      • 31

      #3
      Thanks for your reply.

      I have solved that problem. Actually I didnt give the bitmap index. So that cause the problem

      Comment

      • sicarie
        Recognized Expert Specialist
        • Nov 2006
        • 4677

        #4
        Well, thank you for posting your solution. Please post again if you get stuck.

        Comment

        Working...