Last post Feb 18, 2019 06:59 AM by PGChoudhury
Feb 18, 2019 06:59 AM|PGChoudhury|LINK
I have a very unique scenario at hand and very honestly I am out of depth on how to do this.
In my app. I am generating png image files, with some content in it. The content keeps varying. That's not the main issue.
Well, What is --
My content dimensions are not exact fitting as the dimensions of the file. It is usually smaller, which leaves white/unused spaces in my generated image file.
WHAT I WOULD LIKE TO DO IS --
Have some mechanism that would calculate the size of the inside content height width and then crop/trip the remaining extra portion of the file, so that it's an exact fitting image.
Hope I am able to make you understand what I am trying to achieve here. Use this link to see: [https://imagebin.ca/v/4XPuDCzAAvGm]
What you see here is exactly my case. The inside content itself only occupies part of the total file. So the rest of it is white/empty. Which I want to do away with,and probably create a new file which is the exact fitting one.
How do I do this. Should I use some third party utility? Free? Or would I be required to bu any license.
How about using some core C# calculation logic like starting from the offset point and then doing some kind of calculation and cropping. How should I approach it. Can you at least provide me with some pseudo-code blocks or logical blocks that I may expand step
by step and achieve my goal?
I really really really need it. Please steer me in the right direction. Any kind of suggestions and hints would be helpful for me at this moment!!
Thanks in advance,