Click here to Skip to main content
15,844,362 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: (untagged)
how can i change the image(jpg,png and gif) color in dynamically.plz help me boss..
Posted
Comments
Sergey Alexandrovich Kryukov 8-Aug-11 2:47am    
UI library is not specified.
--SA

1 solution

If you change color dynamically, you change it on the surface of some control or in bitmap. But for a bitmap (and of course for a control), there is no a notion of JPG, PNG or GIF — those are not bitmaps bit the format used to persist a bitmap in the file/stream. By this reason, strictly speaking, the question makes no sense.

All you can do is to create/modify some image dynamically. How you do it, depends on the UI library, which you did not tag. Is it WPF, System.Windows.Forms, anything else? In all cases, you should have some rendering method working with vector or pixel graphics with will be ultimately translated into pixels on screen or the bitmap. Anyway, even if you have such method for on-screen rendering, you can abstract it out for rendering the same image on the bitmap, when it is required. After a bitmap is rendered, you can save it. Only at this moment the choice between JPG, PNG, GIF (one many more) as well as compression parameters and other options comes into play.

I did not provide more detail because you did not specify the UI library. For now the general idea is enough, I think. Please ask you next question properly tagging all the relevant information.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900