Link to home
Start Free TrialLog in
Avatar of MohitPandit
MohitPanditFlag for India

asked on

C#.NET (Graphics): Image properties removed when converting object of Image type to Bitmap type.

Hello Folks,

In .net application when image is processed & merged with another image then its colors are affected.
Image image  ---------> Uploaded image
Bitmap xy = new Bitmap(image, image.Width, image.Height);  -----> Conversion into Bitmap to 

Open in new window

perform various operations like resize or merge with another image
So the “image” object has few “PropertyItems” and when we convert image to Bitmap type of object then these “PropertyItems” array is empty, that means these “PropertyItems” were not moved in this conversion.

Please find below snap shot before before move to Bitmap object.
User generated image
Now after this image is moved into Bitmap object for resize purpose and “PropertyItems” array is empty
User generated image
Actual Image
User generated image
After processing through Bitmap
User generated image
Note: This image is captured through Canon DSLR camera.

Questions
1. What is the reason behind that “PropertyItems” array is empty when convert image to Bitmap type of object.
2. How these properties can be managed when I need to merge two images (using “Graphics” class) and I don’t want forcefully to apply one image’s “PropertyItems” on to other image, to keep original colors of each image respectively.
3. What is the real solution to merge two different images with different quality and PropertyItems with each other and produce quality end result image.
4. Do you any other thoughts?


Best Regards,
Mohit Pandit
ASKER CERTIFIED SOLUTION
Avatar of Chinmay Patel
Chinmay Patel
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MohitPandit

ASKER

Hi Chinmay - I am working on it and get back to you.

Best Regards,
Mohit Pandit
Thanks Exif properties helped a lot for my custom logic.
Glad I could help :)