Hi,
Why not just -
@Override
public void onFrame(final Bitmap mBitmap) {
try {
if (mBitmap != null && headerImageView != null) {
headerImageView.setImageBitmap(mBitmap);
}
} catch (Exception e) {
e.printStackTrace();
}
}
Regards
On Saturday, December 19, 2015 at 8:12:58 AM UTC+11, fah127 wrote:
>
> hi, all
>
> How do it Display Bitmaps frames per seconds in an ImageView efficiently ?
> I am displaying frames per seconds in ImageView from Camera, to prevent
> problems of the Memory Out Error, please
>
> code:
>
> @Override
> public void onFrame(final Bitmap mBitmap) {
> if (headerImageView != null)
> headerImageView.post(new Runnable() {
> @Override
> public void run() {
> try {
> if (mBitmap != null && headerImageView != null) {
> Logger.logPrintMessage("ONFRAMETest",
> "headerImageView", Constants.showLogs);
> ((BitmapDrawable)
> headerImageView.getDrawable()).getBitmap().recycle();
> headerImageView.setImageBitmap(mBitmap);
> hideProgressDialog();
> }
> } catch (NullPointerException e) {
> e.printStackTrace();
> } catch (RuntimeException e) {
> e.printStackTrace();
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> });
>
> }
>
>
--
You received this message because you are subscribed to the Google Groups
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/android-developers/7e1510c7-249e-45db-a016-16b1de058022%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.