我已经完全包括在我的应用程序zxing,使其单机。 它的工作原理,但相机旋转(我认为90逆时针),它有一个奇怪的填充区域。 我的Java:ZXing完全包含,但相机旋转
package it.mi.action.codmmunicator_2ddecoder;
import android.os.Bundle;
import android.widget.Toast;
import android.graphics.Bitmap;
import com.google.zxing.Result;
import com.google.zxing.client.android.CaptureActivity;
public class Lettore extends CaptureActivity{
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.lettore);
}
@Override
public void handleDecode(Result rawResult, Bitmap barcode) {
Toast.makeText(this.getApplicationContext(), "Scanned code " + rawResult.getText(), Toast.LENGTH_LONG);
}
}
和我的XML(这需要斑马线喜欢的活动包括):
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical">
<ImageView android:src="@drawable/head" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<FrameLayout android:layout_width="fill_parent" android:layout_height="250dip">
<include layout="@layout/capture" android:toDegrees="90" />
</FrameLayout>
</LinearLayout>
填充是这样的:https://dl.dropbox.com/u/16047047/Untitled-1.jpg
可有人张贴解决方案?
非常感谢
将其从您的应用程序中删除并与Intents集成。这是系统意图使用的方式。我保证,这会让你头痛得少得多。 – FoamyGuy
但我不能......它必须出现在我的视图中,而不是以新的意图出现(在全屏中进入新的视图)。 如果我可以将意图整合到我的观点中,那很好,但我不知道如何。 换句话说:事情必须保持像我的屏幕:看到下面有一张图片?并且相机是集成的? – Zak
为什么“必须”出现在您自己的视图中?创建BarcodeScanner的人做了很棒的工作。并为您提供了一种简单的方法来将其与您自己的应用程序集成。您正尝试将其源代码复制/粘贴到您的应用中,从而“向上游泳”。它会造成比它的价值更大的麻烦。 – FoamyGuy