This code will crop the image based on all white and transparent pixels from around the image public static Bitmap CropWhiteSpace(Bitmap bmp) { int w = bmp.Width; int h = bmp.Height; int white = 0xffffff; Func< int , bool > allWhiteRow = r => { for ( int i = 0; i < w; ++i) if ((bmp.GetPixel(i, r).ToArgb() & white) != white) return false ; return true ; }; Func< int , bool > allWhiteColumn = c => { for ( int i = 0; i < h; ++i) if ((bmp.GetPixel(c, i).ToArgb() & white) != white) return false ; return true ; }; int topmost = 0; for ( int row = 0; row < h; ++row) { if (!allWhiteRow(row)) break ; topmost = row; } int bottommost = 0; for ( int row = h - 1; row >= 0; --row) { if (!allWhiteRow(row)) break ; bottommost = row; } int leftmost = 0, rightmost = 0; for ( int col = 0; col < w; ++col) { if
the most effective way to invest your savings is
ReplyDeleteproperties for rent in dubai
Properties For Sale In Dubai
property for sale in downtown dubai
property for rent in palm jumeirah
apartments for rent in palm jumeirah
property for rent in downtown dubai
villas for rent in dubai
villas for sale in dubai
property for sale in burj khalifa dubai
apartments for rent in palm jumeirah
apartments for sale in burj khalifa dubai
Apartments for sale in Dubai Hills Estate
Thanks to the blogger for sharing this link.
ReplyDeleteSQL Server Load Soap API
This blog is very knowledgeable .Thankyou for writing this blog .Dreamsoft Consultancy is one of the Leading Company in India who Provide Genuine Experience Certificate in Pune. So Contact here and Get all Details. Contact Us with Get all Details- 9599119376 or check Our Website- https://experiencecertificates.com/experience-certificate-provider-in-Gurgaon.html
ReplyDelete