Zxing Codes using barcode.  Are no exception.

Hello:

I'm scanning the UPCA, UPCE or CODE128 barcodes on my mobile air application.  I followed some examples to try to get on the right track:

http://cookbooks.Adobe.com/post_How_do_I_add_a_QR_code_reader_to_my_Flex_mobile_ap-19074.h tml

http://forums.Adobe.com/thread/890506

I use a 320 x 240 image size.  Set 100 quality.  If someone got it to work properly?

Thank you

-Eric Blom

import com.google.zxing.BarcodeFormat;
                              import com.google.zxing.BinaryBitmap;
                              import com.google.zxing.BufferedImageLuminanceSource;
                              import com.google.zxing.DecodeHintType;
                              import com.google.zxing.Result;
                              import com.google.zxing.client.result.ParsedResult;
                              import com.google.zxing.client.result.ResultParser;
                              import com.google.zxing.common.GlobalHistogramBinarizer;
                              import com.google.zxing.common.flexdatatypes.HashTable;
                              import com.google.zxing.qrcode.QRCodeReader;
                              import mx.core.UIComponent;
                              import spark.events.ViewNavigatorEvent;
  
                              private var camera:Camera;
                              private var cameraVideo:MovieClip;
                              private var videoDisplay:Video=new Video(320, 240);
                              private var qrReader:QRCodeReader;
                              private var bmd:BitmapData;
                              private var cameraStarted:Boolean = false;
                              private var detectChange:Timer;
  
                              protected function view1_viewActivateHandler(event:ViewNavigatorEvent):void
                              {
                                        qrReader = new QRCodeReader();
                                        if(!cameraStarted)
                                        {
                                                  if(Camera.isSupported)
                                                  {
                                                            camera = Camera.getCamera();
                                                            camera.setQuality(0, 100);
                                                            camera.setMode(320, 240, 8, false);
  
                                                            videoDisplay.attachCamera(camera);
                                                            videoDisplay.width = camera.width;
                                                            videoDisplay.height = camera.height;
                                                            videoDisplay.x = 0;
                                                            videoDisplay.y = 0;
                                                            videoDisplay.cacheAsBitmap = true;
                                                            //videoDisplay.rotation=90;
                                                            sv.addChild(videoDisplay);
  
                                                            var uic:UIComponent = new UIComponent();
                                                            uic.graphics.lineStyle(3,0xFF0000);
                                                            uic.graphics.drawRect(0,0,260,180);
                                                            uic.horizontalCenter = uic.verticalCenter = 0;
                                                            uic.width = videoDisplay.width;
                                                            uic.height = videoDisplay.height;
                                                            sv.addChild(uic);
  
                                                            cameraStarted = true;
                                                            TimerExample();
                                                  }
                                                  else
                                                  {
                                                            scanLabel.text = "Error: No camera found.";
                                                  }
                                        }
                              }
  
                              public function TimerExample():void
                              {
                                        detectChange=new Timer(1888);
                                        detectChange.addEventListener(TimerEvent.TIMER, decodeSnapshot);
                                        detectChange.start();
                              }
  
                              private function focusCamera():void
                              {
                                        camera = Camera.getCamera();
                                        camera.setQuality(0, 100);
                                        camera.setMode(320, 240, 8, false);
                                        camera.setLoopback(false);
                                        videoDisplay.attachCamera(camera);
                              }
  
                              protected function scanButton_clickHandler(event:MouseEvent):void
                              {
                                        decodeSnapshot(null);
                              }
  
                              private function decodeSnapshot(event:TimerEvent):void
                              {
                                        scanLabel.text = "Checking...";
                                        bmd = new BitmapData(320, 240);
                                        bmd.draw(videoDisplay, null, null, null, null, true);
                                        videoDisplay.cacheAsBitmap = true;
                                        videoDisplay.cacheAsBitmapMatrix = new Matrix;
                                        decodeBitmapData(bmd, 320, 240);
                                        bmd.dispose();
                                        bmd = null;
                                        System.gc();
                              }
  
                              public function decodeBitmapData(bmpd:BitmapData, width:int, height:int):void
                              {
                                        var lsource:BufferedImageLuminanceSource=new BufferedImageLuminanceSource(bmpd);
                                        var bitmap:BinaryBitmap=new BinaryBitmap(new GlobalHistogramBinarizer(lsource));
  
                                        var ht:HashTable=null;
                                        ht=this.getAllHints();
  
                                        var res:Result=null;
                                        try {
                                                  res=qrReader.decode(bitmap, ht);
                                        }
                                        catch (event:Error) {
                                                  scanLabel.text = event.name + " - " +event.message + " - " + event.getStackTrace();
                                                  trace(event.name + " - " +event.message + " - " + event.getStackTrace());
                                        }
  
                                        if (res == null) {
                                                  videoDisplay.clear();
                                                  scanLabel.text="nothing decoded";
                                        }
                                        else {
                                                  var parsedResult:ParsedResult = ResultParser.parseResult(res);
                                                  scanLabel.text=parsedResult.getDisplayResult();
                                                  sv.removeChild(videoDisplay);
                                                  cameraStarted = false;
                                        }
                              }
  
                              public function getAllHints():HashTable
                              {
                                        var ht:HashTable = new HashTable();
                                        //ht.Add(DecodeHintType.POSSIBLE_FORMATS, BarcodeFormat.QR_CODE);
                                        ht.Add(DecodeHintType.POSSIBLE_FORMATS,BarcodeFormat.UPC_E);
                                        ht.Add(DecodeHintType.POSSIBLE_FORMATS,BarcodeFormat.UPC_A);
                                        ht.Add(DecodeHintType.POSSIBLE_FORMATS,BarcodeFormat.CODE_128);
                                        ht.Add(DecodeHintType.TRY_HARDER, true);
  
                                        return ht;
                              }

OK, if it might help someone down the line:

I realized that my camera and video sizes were inconsistent and that it got rid of the white space.  Also, I used an instance of QrReader() to try to read UPC_A and UPC_E formats.  The way I found to work was using an instance of MultiFormatOneDReader() instead.

Tags: Adobe AIR

Similar Questions

  • I got a notification saying "password requirement: you must change your secret code in 56 minutes"I panicked and entered my access code using the little box? ". I ' t mess up?

    I got a notification saying "password requirement: you must change your secret code in 56 minutes"I panicked and entered my access code using the little box? ". I ' t mess up?

    Yes. You may be victim of a scam, except if you are connected to your business with this requirement.

    Change your password immediately below:

    https://appleid.apple.com.

  • How do we code using Concatfields/Connectfields rules in Documaker?

    Hello

    I knew that the concept of Concatfields/Connectfields these rules. I want to explore more on these rules. I still don't get how we code using these rules? Please help me to encode using this...

    I created a section with two fields named TEST1 and TEST2.
    Test1 - I used the rule MK_HARD and passing a value like "count:". "
    Test2 - I used the rule MK_HARD and passing a value like "December".


    In the level in accordance with article article section I select rule Concatfields and mentioned there as F = TEST1, R = TEST2;
    Now, I have added this section to the form and execution of the batch file, but I got the following error.

    DM10157: Error in < CONCATFIELDS >: < TEST2; > is an invalid field. Image: < TEST >. This rule does not work with the fields of type of barcode or multiline text fields.
    DM12086: Error in RPDoImageRules(): < CONCATFIELDS > (impossible).

    Means so I've coded it wrong. Please help me understand how the code using these rules?

    Note:
    (A) I'm using documaker 11.5.
    (B) I understood as the use of these rules, we can concatinating the fields.

    Thank you
    RAMAN C

    Hello Raman,

    CONCAT: This serves to concat two or more strings of text.
    For example: you have a HDR file and posted on 30 you have a text 'A', at position 40 you have a 'B' text and position 50 you have a text 'C '.
    In this case when you use CONCAT 1 fields, HDR 30,1,40,1,50,1 your output would be A B C

    CONNECTFIELDS/ConcatFields: This rule is used for the login fields that are horizontally aligned.
    For example: I have 3 domains Field_A Field_B Field_C of an image in a row. and when I use the Conenct Fields rule, F = Field_A, R = Field_B, R = Field_C. Now, I have no data printing in Field_B in this case, the output would be Field_A Field_C

    Just give the name of the rule as ConnectField and in the data column: F = Field_A, R = Field_B, R = Field_C without any semicolons.

    Let me know if you have any questions in case

    Thank you very much
    Deborah Vandenplas

  • Weather code using QNetworkRequest example

    I try to get the temperature of using QNetworkRequest time as follows:

    ===================================

    QNetworkAccessManager qNam;
    QNetworkReply * temperReply;

    void Class::getWeatherTemperature (lat, lon QString QString) {}

    temperReply = qNam.get(QNetworkRequest(QUrl("api.openweathermap.org/data/2.5/weather?lat="+lat+"&lon="+lon)));

    Connect (temperReply, SIGNAL (finished (()), this, SLOT (onFinishedTemperature ()));

    }

    void class: {onFinishedTemperature()}

    QNetworkReply * weatherReply = dynamic_cast(sender());

    qDebug() < weatherreply-=""> errorString() < weatherreply-=""> attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();)

    another code

    }

    ==================================

    but it does not work... I myself errorString: Protocol "" is unknown

    are there any examples of weather code using QNetworkRequest?

    Finally worked by call 'connect' before 'get' and by the way the Manager object (not the answer) of network access to the connect function as in this link:

    https://developer.BlackBerry.com/native/documentation/Cascades/device_comm/networking/index.html

  • I use a book on puzzles of lingo and 12 Director dislikes in the code using [cc]

    The game is a game of searching for words in a book of advanced jargon and lingo code uses [cc], who is coming as an error code.  What is the problem, or is this use of [cc] obsolete?  And if so, how can it be corrected?  Thank you.

    on getPropertyDescriptionList me

    List = [:]

    -members of the text with the words it contains

    list of addProp, #pWordSource, [cc]

    [#comment: "Source term",[cc] ]

    #format: #text,[cc]

    [#default: VOID]

    list of addProp, #pEndGameFrame,[cc]

    [#comment: 'End Game Frame',[cc] ]

    #format: #marker,[cc]

    [#default: #next]

    back list

    end

    [cc] here stands for "continuation character. Prior to Director 8, this level was ¬ and the Director 8 go it is------(immediately followed by a carriage return). Assuming you are using a 21st century Director version, it should work for you:

    on getPropertyDescriptionList me

    List = [:]

    -members of the text with the words it contains

    List of addProp, #pWordSource,------.

    [#comment: ' word Source ', \]

    #format: #text,

    [#default: VOID]

    List of addProp, #pEndGameFrame,------.

    [#comment: 'End Game Frame', \]

    #format: #marker,

    [#default: #next]

    back list

    end

  • Deploying the file of cod using OTA (On The Air)?

    Hi all

    I have developed a small blackberry app and you want to deploy using the OTA. I sent a war file that includes the .jad, .cod and .alx files. But when I run the URL and try to download the jad file, it gives me error.

    "http 907 404 invalid COD error not found "

    Can someone help me solve this problem?

    Thank you

    Manish Kumar

    The .cod file, the compiler creates is usually an archive other cod files.

    Extract the original .cod using WinZip (or another application) to another directory, copy the .jad file to reside next to the extracted file to cod and to change your URL accordingly.

    Visit this link:

    http://assets.handango.com/marketing/developerTeam/BlackBerryOTADeployment.PDF

    E.

  • Conversion of a MIDlet on a COD using the JDE

    Hello

    I'm trying to convert a MIDlet (built with Netbeans) a COD using JDE 3.0. I used the instructions in:

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800738/800901/How_To _...

    When I built the MIDlet using Netbeans, I turned off obfuscation and JAR compression. Nevertheless, no matter what I do, I got:

    Building MyProject
    C:\Program Research In Motion\BlackBerry JDE 4.3.0\bin\rapc.exe-silencieux import ="...... \.. \.. \.. \.. \Program Files\Research in Motion\BlackBerry JDE 4.3.0\lib\net_rim_api.jar"codename = MyProject-midlet warnkey = 0 x 52424200; 0 x 52525400; 0 x 52435200 C:\MyProject\dev\clients\MyProject\dist\J2ME\MyProject-J2ME.jad C:\MyProject\dev\clients\MyProject\dist\J2ME\MyProject-J2ME.jar
    Error! 907: impossible to verify security

    Any suggestions?

    Your JAR file is signed?  CAP does not support the conversion of signed JAR files.

    If not, try to remove the - quiet parameter and you should see more information about the error.

  • new iMac won't let me use the area of the Image

    I have an iMac with OS X 10.9.4.

    I have always used HP Image Zone with my old but still-going-strong Photosmart 3210 printer/scanner, especially to edit my photos.

    Although the Mac is very happy to talk to the printer and the printing and scanning, it will not Image area install because it says "Power PC applications are no longer supported".

    Is there any solution for this? A new application or perhaps a plug-in?

    Downloads available, that I tried not to do the trick, and I really can't on with iPhoto.

    Hi higgi-san, welcome to the forums!

    I noticed your post not being able to use the area of the Image with your OS X 10.9.4. After checking into it for you, there is no comprehensive software available on the Mavericks for the Photosmart 3210.

    HP Photosmart 3210 all-in-one printer drivers

    Although it is not the best news, I hope it helps to confirm your question.

    Have a wonderful weekend

  • I just want to know if Avanquest SystemSuite 12 and Avanquest Fix - It Utilities Professional of 12 software are good to use and are worth the price?

    Hi all

    I just want to know if these two software are good to use and are worth the price?

    Avanquest SystemSuite Professional 12 - $ 49.99

    Avanquest Fix-It Utilities Professional 12 - $ 39.99

    I intend to try the software but I have my doubts too if the price is right and editing the registry using software is a bit of a long shot, what do you think?

    Any suggestion is welcome here.

    Anyone used software?

    Original title: I just want to know any suggestions of experts

    Hey Ross,

    You can see the following link, the information provided in the following link are as well applies to Windows 8.

    Microsoft supports the use of the registry cleaning utilities policy.

    http://support.Microsoft.com/kb/2563254/en-us

  • view the sql code used in a cfquery that performs an update

    I want to see the sql code used in a cfquery that performs an update. I can't do it at all, advice?

    Have you looked at the docs? May I suggest the attribute of 'result '.

  • next_record using barcoder

    Hi all

    I use barcode reader that I want when I filled a form barcode reader point then it will go to NEXT_RECORD

    Please Guide
    Thanks and greetings
    Vikas SInghal

    First explain what you really want to achieve.

    François

  • Used dump area is 98%

    I am running oracle 10g on linux. My contol watch database space using only: used dump area is 98%. How to solve this? Thank you

    $ cd/ora/app/oracle/admin/orcl /.
    $ the - MS * | Sort - n

    Remove the old file of track of this place? I mean the command to use

    In udump... you can delete all trace files, delete anyway old > 7 days
    Example:
    $ cd/ora/app/oracle/admin/orcl/udump
    $ find. / - type f-name ' * .trc ' - mtime + 7 - exec rm ().

    In bdump... you can delete old trace files,

    Example: > 30 days

    $ cd/ora/app/oracle/admin/orcl/bdump
    $ find. / - type f-name ' * .trc ' - mtime + 30 - exec rm ().

    On alert logfile in bdump path (/ ora/app/oracle/admin/orcl/bdump /) ;) you can move it... or backup file again or remove (if you do not want)... because oracle does not take to this topic

    Example:

    $ mv alert_db.log alert_db.log.old
    $ gzip-9 alert_db.log.old
    $ sqlplus / as sysdba
    SQL > alter system switch logfile;

    Modified system.
    SQL >! ls - the alert *.
    -rw - rw - 1 oracle oinstall 241 27 June at 17:51 alert_db.log
    -rw - r - 1 oracle oinstall 7290 26 June at 23:09 alert_db.log.old.gz

  • Using the code scanner barcode

    Hai Experts

    We created an application for the trial Board of horn using LabVIEW, almost our project is now finished the client gave us another task that the need to analyze the sample number through bar codes and write this number in the report... They give information about the type of scan that they use, I want just a vi for this sample. One test takes about 2 to 3 minutes...

    Hi Lisette,

    If you read its technical specifications, Interfaces are keyboard, RS232, USB Interface.

    So I think that you can directly get the scanned value as I mentioned.

    When you buy it, you will get manual user, so there are barcodes for the various modes.

    BUT when I googled on the scanner, I am manual, who says he has connector RS232, and you will need to send command to receive data from the scanner.

    Please go through this link. And attachment. You can ask the dealer where you buy this scanner for confirmation on interface.

    http://www.ARGOX.com/content.php?SNO=0000081&P_ID=37 (specifications and downloads)

    If I get more information, then I'll let you know.

  • Are there disadvantages to the use of libraries in the project to organize common code used by different projects?

    My company is trying to determine how best to organize and share our common code. We use subVersion. We have several important programs that are deployed on different machines, some of which are running older versions of labview. I read a lot of documents on how to share the code, but I still don't know if it makes sense to use the project libraries to organize the code which will be shared by several projects. Another option is the package build. Can someone comment on the advantages and disadvantages? Thank you.

    Because you use several versions of LabVIEW, go with the packages.

    The project libraries are stored in a specific version of LabVIEW.  So if someone registers in 2014, you can't use it in 2013.

    If you use packet, then you have a core library that is 'installed' for a specific version of LabVIEW.  Each version of LabVIEW can have its own installation of this package.

  • bought a used precision sidewinder pro, except the ports on my hp pravilion slimeline are not he same

    There are no ports on the back of my tower to connect the joy stick to.

    You need to get a converter (/) I guess if you have not all ports. Or switch the motherboard with USB ports.

    http://www.TechSpot.com/VB/topic26473.html

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_other-gaming/joystick-not-detected/88300607-1d57-44a4-980F-5f2d2ebd56d7

Maybe you are looking for