How do I Find an empty area in a bitmap image

时间:2016-02-12 20:07:44

标签: android android-bitmap

How can I detect empty area in bitmap. in the imageView there is a bitmap. I get it use getbitmap() method. it is .png format and one part of image is empty.

Is there any way to detect that area?

2 个答案:

答案 0 :(得分:0)

Consider your Undefined symbols for architecture x86_64: "_ACAccountTypeIdentifierTwitter", referenced from: -[PF_Twitter _getLocalTwitterAccountAsync] in ParseTwitterUtils(PF_Twitter.o) "_FBTokenInformationExpirationDateKey", referenced from: -[PFFacebookTokenCachingStrategy cacheTokenInformation:] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o) -[PFFacebookTokenCachingStrategy expirationDate] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o) -[PFFacebookTokenCachingStrategy setExpirationDate:] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o) "_FBTokenInformationTokenKey", referenced from: -[PFFacebookTokenCachingStrategy accessToken] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o) -[PFFacebookTokenCachingStrategy setAccessToken:] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o) "_FBTokenInformationUserFBIDKey", referenced from: -[PFFacebookTokenCachingStrategy facebookId] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o) -[PFFacebookTokenCachingStrategy setFacebookId:] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o) "_OBJC_CLASS_$_ACAccountStore", referenced from: objc-class-ref in ParseTwitterUtils(PF_Twitter.o) "_OBJC_CLASS_$_FBAppCall", referenced from: objc-class-ref in ParseFacebookUtils(PFFacebookAuthenticationProvider.o) "_OBJC_CLASS_$_FBRequest", referenced from: objc-class-ref in ParseFacebookUtils(PFFacebookAuthenticationProvider.o) "_OBJC_CLASS_$_FBSDKAccessToken", referenced from: objc-class-ref in ParseFacebookUtilsV4(PFFacebookPrivateUtilities.o) objc-class-ref in ParseFacebookUtilsV4(PFFacebookAuthenticationProvider.o) objc-class-ref in ParseFacebookUtilsV4(PFFacebookUtils.o) "_OBJC_CLASS_$_FBSDKApplicationDelegate", referenced from: objc-class-ref in ParseFacebookUtilsV4(PFFacebookAuthenticationProvider.o) "_OBJC_CLASS_$_FBSDKLoginManager", referenced from: objc-class-ref in ParseFacebookUtilsV4(PFFacebookMobileAuthenticationProvider.o) "_OBJC_CLASS_$_FBSDKSettings", referenced from: objc-class-ref in ParseFacebookUtilsV4(PFFacebookPrivateUtilities.o) "_OBJC_CLASS_$_FBSession", referenced from: objc-class-ref in ParseFacebookUtils(PFFacebookAuthenticationProvider.o) "_OBJC_CLASS_$_FBSessionTokenCachingStrategy", referenced from: _OBJC_CLASS_$_PFFacebookTokenCachingStrategy in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o) "_OBJC_METACLASS_$_FBSessionTokenCachingStrategy", referenced from: _OBJC_METACLASS_$_PFFacebookTokenCachingStrategy in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) as Bitmap

bitmap

If int color = bitmap.getPixel((int) event.getX(),(int) event.getY()); , It is color = 0.

else It is transparent.

答案 1 :(得分:0)

l1 = [i for i in l1 if i <= x]

l1.append(x)

l2 = [i for i in l2 if i >= x]

l2.insert(0, x)

This should give you the level of Bitmap bitmap = ((BitmapDrawable)image.getDrawable()).getBitmap(); int transparency = ((bitmap.getPixel(x,y) & 0xff000000) >> 24); of the pixel in transparency.

The value of coordinates(x,y) will be between transparency and 0, when 255 is completely transparent and 0 is completely opaque.