Reputation: 1503
I'm looking for an automatic way to grab a piece of a bitmap and extract a certain part of it.
Let me explain:
If I have this image:
https://i.sstatic.net/DsDwe.jpg
It has a big white border. (see link for better white result) I'm looking for a way to only grab the dialog above. So no white borders around the dialog. Is there a way to do this by code or with a library?
You should know that the image could have any form and positioned anywhere on the white dialog.
So a user draws something on the white panel and i need the program to automatically make a rectangle about where the users drew on the canvas and save that bitmap where the user drew on the canvas (Everything in between that rectangle).
Upvotes: 1
Views: 4041
Reputation: 5613
Pseudocode
For a Java code example, please see: How to auto crop an image white border in Java?
Upvotes: 1