當前位置:編程學習大全網 - 網站源碼 - zxing 二維碼消耗內存太大,項目容易崩潰,怎麽解決

zxing 二維碼消耗內存太大,項目容易崩潰,怎麽解決

zxing不會吧,妳把掃描框調整壹下,不要這麽大

這個就是設置掃描框的常量

getFramingRect 方法建議妳改壹下

?/**

*?Calculates?the?framing?rect?which?the?UI?should?draw?to?show?the?user?where?to?place?the

*?barcode.?This?target?helps?with?alignment?as?well?as?forces?the?user?to?hold?the?device

*?far?enough?away?to?ensure?the?image?will?be?in?focus.

*

*?@return?The?rectangle?to?draw?on?screen?in?window?coordinates.

*/

public?Rect?getFramingRect()?{

Point?screenResolution?=?configManager.getScreenResolution();

if?(framingRect?==?null)?{

if?(camera?==?null)?{

return?null;

}

int?width?=?(int)?(screenResolution.x?*?4?/?5);

if?(width?<?MIN_FRAME_WIDTH)?{

width?=?MIN_FRAME_WIDTH;

}

int?height?=?(int)?(screenResolution.y?/?1.5);

int?leftOffset?=?(screenResolution.x?-?width)?/?2;

int?topOffset?=?(screenResolution.y?-?height)?/?2;

framingRect?=?new?Rect(leftOffset,?topOffset,?width?+?leftOffset,?width?+?leftOffset);

Log.d(TAG,?"Calculated?framing?rect:?"?+?framingRect);

}

return?framingRect;

}

這是我的zxing掃描源碼

  • 上一篇:求救!!C語言 讀取當天日期、時間的函數(VC的編譯環境)
  • 下一篇:Tik Tok哪裏有扇盾?
  • copyright 2024編程學習大全網