Click to See Complete Forum and Search --> : Need help to edit an Image file


sulabh120881
December 29th, 2008, 05:52 AM
Hi all,

I am creating a dialog for preview an Image file after displaying it to the picture control of dialog I need to edit this means draw a line circle with use of pen and brush and save the changed file in to same format.
Please tell me how can i edit and save this image file..

Thanks in advance

Mike Harnad
December 30th, 2008, 09:48 AM
Assuming that your image file is a bitmap, you can load it into a memory DC and draw onto it. Once ytou've update the DC, you can save it by using the method mentioned in this article (http://www.codeguru.com/cpp/g-m/bitmap/article.php/c1697/). For more info on working with image files, consult the bitmaps and palettes (http://www.codeguru.com/cpp/g-m/bitmap/) section on CodeGuru.

sulabh120881
December 31st, 2008, 02:05 AM
Assuming that your image file is a bitmap, you can load it into a memory DC and draw onto it. Once ytou've update the DC, you can save it by using the method mentioned in this article (http://www.codeguru.com/cpp/g-m/bitmap/article.php/c1697/). For more info on working with image files, consult the bitmaps and palettes (http://www.codeguru.com/cpp/g-m/bitmap/) section on CodeGuru.

Thanks this looks applicable.
But if I needs to do the same with jpg and png also than what should i do??

Thanks again

Mike Harnad
December 31st, 2008, 09:03 AM
You would need to convert it to a bitmap first. Something like this (http://www.codeguru.com/cpp/g-m/bitmap/article.php/c4935/), or, this (http://www.paintlib.de/paintlib/) should help.