473,772 Members | 2,442 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Palette Color Not Changed

31 New Member
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.
Oct 6 '07 #1
3 2397
sicarie
4,677 Recognized Expert Moderator Specialist
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?
Oct 9 '07 #2
krishnasamy
31 New Member
Thanks for your reply.

I have solved that problem. Actually I didnt give the bitmap index. So that cause the problem
Oct 16 '07 #3
sicarie
4,677 Recognized Expert Moderator Specialist
Well, thank you for posting your solution. Please post again if you get stuck.
Oct 17 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1850
by: Jean-Sebastien Carle | last post by:
I've been ripping my hair our trying to get this to work for a week and I can't seem to get it. I'm trying to display a 4BppIndexed Bitmap from within the ntoskrnl.exe file that contains no palette. This bitmap is the one everyone likes to change to customize their boot screen. My goal is not to edit the kernel, but simply to display the bitmap content in much the same way a resource editor does. My problem is that no matter what I do, the...
4
4100
by: Just Me | last post by:
I asked this in the VB NG and didn't get a response. I think this NG is no apt to know this kind of thing so I'm trying here. Trying to display the palette that is on the clipboard. I get a palette from the clipboard and I want to make the picturebox display it and realize it as its palette. Actually the picturebox is on a usercontrol which is on the form containing this code.
0
1086
by: Micus | last post by:
Hi all, Does anyone have experience with using a palette with a progress control? Everything works fine with a scrollbar control, but I think there are issues with the progress control because it's a common control. For the scrollbar, I can select the palette in the WM_CTLCOLORSCROLLBAR message which works fine, but the progress bar does not send a similar message. The progress control displays and works fine, but the color of the bar and...
0
1164
by: Carles | last post by:
Hi, Currently, I use a cDIB class to manage all color depth DIBs. But now I would like to avoid selecting my hDIB into a DC, and process all through manipulating data directly from/through lpBits (color data pointer). The problem comes at time to load palette based bitmaps through LoadImage API. Now, once I have hDIB, I select into a DC and extract palette using GetDIBColorTable. My question is if it's possible to extract palette without...
1
5822
by: Stuart | last post by:
I am using the Python Imaging Library (PIL) to process GIF images. I need to be able to retrieve the RGB values for each color palette entry. I see that the 'Image' class has a 'palette' attribute which returns an object of type 'ImagePalette'. However, the documentation is a bit lacking regarding how to maniuplate the ImagePalette class to retrieve the palette entries' RGB values. Can anyone point me to a short example? Thanks!
0
1251
by: Matteo | last post by:
Hi, i sent image byte via bt from j2me phone to c# application, after i have to create image using this code: .... byte pixels .... Bitmap bmp = new Bitmap(160, 120, PixelFormat.Format8bppIndexed);
1
5320
by: mrajanikrishna | last post by:
Hello, I am developing an application in which the user has to select his choice of colors and displaying the images with that color. How can I display color palette to the user and return the selected color? thanx in advance
15
2056
by: active | last post by:
Below is a small but complete program that appears to show you can't retrive a Palette from the clipboard. This is true whether the palette is placed on the clipboard by Photoshop or Photoshop or by the below program It lets you place a palette from a file or from a program on the clipboard and allows you to retrieve one from the clipboard. But you'll find the retrieved one is always "Nothing"
8
2505
by: active | last post by:
Guess I'm looking for someone who likes to work difficult puzzles. I can't seem to ever retrieve a palette handle from the clipboard. Below is a simple test program that demonstrates the problem. The program uses windows api to get a handle to a palette from the clipboard. The palette needs to be put there by another program - maybe Photoshop.
0
9621
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10264
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9914
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8937
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7461
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4009
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3610
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2851
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.