Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a folder having many images , where i need to verify the DPI of the images (wether 300 or not) . if its not 300, then it should convert it to 300 DPI. Using C# .net i have to do this. Can any one give me a solution
Posted
Comments
Sergey Alexandrovich Kryukov 7-Oct-13 4:26am    
This is pretty easy, but http://whathaveyoutried.comso far?
And why would you need all those DPI? They are pretty much irrelevant to most imagine chores.
—SA

 
Share this answer
 
Comments
Praveen SKumar 7-Nov-13 23:50pm    
Helped me lot.
Thanks
Sergey Alexandrovich Kryukov 8-Nov-13 0:01am    
My pleasure.
Good luck, call again.
—SA
Load your image into a System.Drawing.Image. The fields HorizontalResolution and VerticalResolution give you DPI, so you need to check they are both 300.

You need to be clearer about what to do if the DPI is not 300. You could just set it to 300 which may cause the overall 'display size' to change, or you could resize it to preseve the size but then you might end up interpolating the pixels.

If it's just the first, I'd look at SetPropertyItem which I suspect will be able to do it, but I've never tried...
 
Share this answer
 
Thanks a lot guyz for your replies.
 
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