Click here to Skip to main content
15,898,791 members
Home / Discussions / C#
   

C#

 
QuestionHow can i crop only the used part of a Bitmap? Pin
bonzaiholding29-Jul-09 21:36
bonzaiholding29-Jul-09 21:36 
AnswerRe: How can i crop only the used part of a Bitmap? Pin
stancrm29-Jul-09 21:41
stancrm29-Jul-09 21:41 
GeneralRe: How can i crop only the used part of a Bitmap? Pin
bonzaiholding29-Jul-09 22:39
bonzaiholding29-Jul-09 22:39 
AnswerRe: How can i crop only the used part of a Bitmap? Pin
Luc Pattyn29-Jul-09 22:17
sitebuilderLuc Pattyn29-Jul-09 22:17 
GeneralRe: How can i crop only the used part of a Bitmap? Pin
bonzaiholding29-Jul-09 22:44
bonzaiholding29-Jul-09 22:44 
GeneralRe: How can i crop only the used part of a Bitmap? Pin
Luc Pattyn29-Jul-09 22:58
sitebuilderLuc Pattyn29-Jul-09 22:58 
GeneralRe: How can i crop only the used part of a Bitmap? Pin
jasonmp19-Nov-10 5:00
jasonmp19-Nov-10 5:00 
AnswerRe: How can i crop only the used part of a Bitmap? Pin
Moreno Airoldi30-Jul-09 0:09
Moreno Airoldi30-Jul-09 0:09 
If I understand correctly, your problem is locating the image you want to crop inside the bitmap.
You said that it will always be a rectangle, and you talk about "empty" and "full" or "used" and "unused" pixels.
This simplifies your problem a lot! You should be aware that image recognition is a rather complex field, and without these two assumptions you would have to go for complex solutions.

Now, if you know the characteristics of the "empty" or "unused" pixels, you can recognize them. Fox example, they might be all of the same color (white ? black ?). So, starting from the corners of the image you can detect the first "used" pixels and define your cropping rectangle.

How you do it is strongly dependant on the inner image characteristics. For example, if ALL of the inner image's pixels are different from the "unused" ones (different color, in my example), then you can walk along the diagonals of your bitmap to find the cropping area and then define it by walking along its edges if necessary, and so on.

Hope this gives you some ideas. Smile | :)

2+2=5 for very large amounts of 2
(always loved that one hehe!)

QuestionRequired data through http connection Pin
honeyashu29-Jul-09 21:01
honeyashu29-Jul-09 21:01 
AnswerRe: Required data through http connection Pin
SeMartens29-Jul-09 21:08
SeMartens29-Jul-09 21:08 
GeneralRe: Required data through http connection Pin
honeyashu29-Jul-09 22:18
honeyashu29-Jul-09 22:18 
GeneralRe: Required data through http connection Pin
stancrm29-Jul-09 22:31
stancrm29-Jul-09 22:31 
AnswerRe: Required data through http connection Pin
Manas Bhardwaj29-Jul-09 21:08
professionalManas Bhardwaj29-Jul-09 21:08 
AnswerRe: Required data through http connection Pin
stancrm29-Jul-09 21:09
stancrm29-Jul-09 21:09 
Questiondatabase conectivity in C# Pin
MahaKh29-Jul-09 19:19
MahaKh29-Jul-09 19:19 
AnswerRe: database conectivity in C# Pin
Aman Bhullar29-Jul-09 19:25
Aman Bhullar29-Jul-09 19:25 
AnswerRe: database conectivity in C# Pin
bilal haider29-Jul-09 19:45
bilal haider29-Jul-09 19:45 
AnswerRe: database conectivity in C# Pin
CoderForEver29-Jul-09 23:34
CoderForEver29-Jul-09 23:34 
GeneralRe: database conectivity in C# Pin
nelsonpaixao30-Jul-09 14:34
nelsonpaixao30-Jul-09 14:34 
QuestionHow to find the Position of an element (Html Tag) on an HTML page using c#? Pin
svt gdwl29-Jul-09 18:30
svt gdwl29-Jul-09 18:30 
AnswerRe: How to find the Position of an element (Html Tag) on an HTML page using c#? Pin
dan!sh 29-Jul-09 19:04
professional dan!sh 29-Jul-09 19:04 
QuestionWebBrowser Pin
nelsonpaixao29-Jul-09 18:09
nelsonpaixao29-Jul-09 18:09 
QuestionHow to make repeated calls to a DLL from C#? Pin
J.G.W29-Jul-09 17:09
J.G.W29-Jul-09 17:09 
AnswerRe: How to make repeated calls to a DLL from C#? Pin
Richard Andrew x6429-Jul-09 17:12
professionalRichard Andrew x6429-Jul-09 17:12 
AnswerRe: How to make repeated calls to a DLL from C#? Pin
Vimalsoft(Pty) Ltd29-Jul-09 21:06
professionalVimalsoft(Pty) Ltd29-Jul-09 21:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.