Convert binary (Blob) image file to string base64 on PlayBook?

I need to download image files of the PlayBook to a Web server.

When you use BB10, it's pretty easy, basically just using reader.readAsBinaryString (file) to get the file as a string, encode in Base64, then send it with xml.send(fileData). Which works very well with my Z10.

But the PlayBook seems to have its own file system that does not work the same as handling BB10. I can read the file very well with blackberry.io.file.readFile (path, pbOpenImageFile)image, but it gives me just the Blob. How can I get this Blob converted a Base64 string for sending with xml.send (fileData)?

blackberry.utils.blobToString (blobData) doesn't seem to work, at least not with my image data (works very well with my text files however). He also apparently has a size limit that could be a problem with the images anyway.

Is it possible to get that converted to a string in Base64 Blob?

I have it.

Take the idea of here something like:

var can = document.getElementById ('canvas');
var can.getContext ('2d') = CTX;
var img = document.getElementById ('tweetpic');
ctx.drawImage (img, 0, 0);
var b64Text = can.toDataURL ();
b64Text = b64Text.replace ("data : image/png;") Base64,', ");
var fileData = b64Text;

And then xml.send (fileData); as usual

Tags: BlackBerry Developers

Similar Questions

  • Cannot write data blob image file

    Hello

    I am trying to write in a persistent storage of an image blob data... even if I don't get an error, that nothing is written

    window. rootFS.getFile (window. mainDirectory + ' / ' + $scope.) sCurrentDate + "/" + filename. substring (file name of0 . lastIndexOf ('.')) + '.jpg' {create:true} { function(file)

    file.createWriter (function(fileWriter) {}

    fileWriter. write (oXHR. ( responseText) ;
    fileWriter. onwriteend = function (e) {}

    Console. Journal ("file image = >""") ;
    console. Journal (e) ;
    console. Journal (file) ;
       });

       };
    { } { function(error)

    Console. Journal (error) ;
      });
    } { function(e)

    Console. Journal (e) ;
    });

    honestly, I don't know what to try anymore

    Good. So something has changed at the same time, because in your OP, you wrote:

    nothing is written

    and now you say:

    the file is created, but the image link seems broken

    All plugins:

    1. the plugin file is integrated into the plugin to transfer files, so you should not the former.

    2. There is not these plugins by these names on the repo of old, obsolete "bmp".

    3. the latest versions of these plugins to the NPM are 4.2.0 and 1.5.1 so you have included older versions

    4. you must use the latest syntax and NPM and therefore write:

    Now, what is "the link of the image" and how seems to be broken?

  • Convert an image file in Base64 or another string value

    Hello

    I need to read the content an image file () JPEG, PNG, TIFF) and convert this file to Base64 string.

    Anyone know if you can do these things the Javascript in InDesign?

    Thank you any help

    EDIT: I forgot to add that I know my image path on filesystem, it lies within the my file system. I get this way thanks to InDesign...

    Hello

    You need:

    var file = new File (pathFile);

    then

       file.encoding = "BINARY";

    Ok. Let's try this:

    var base64Encode = function(/*str*/s)
    //--------------------------------------
     {
        var ALPHA = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
    
        var n = s.length,
            a = [], z = 0, c = 0,
            b, b0, b1, b2;
    
        while( c < n )
            {
            b0 = s.charCodeAt(c++);
            b1 = s.charCodeAt(c++);
            b2 = s.charCodeAt(c++);
    
            var b = (b0 << 16) + ((b1 || 0) << 8) + (b2 || 0);
    
            a[z++] = ALPHA.charAt((b & (63 << 18)) >> 18);
            a[z++] = ALPHA.charAt((b & (63 << 12)) >> 12);
            a[z++] = ALPHA.charAt(isNaN(b1) ? 64 : ((b & (63 << 6)) >> 6));
            a[z++] = ALPHA.charAt(isNaN(b2) ? 64 : (b & 63));
            }
    
        s = a.join('');
        a.length = 0;
        a = null;
        return s;
    };
    
    var fileToBase64 = function(/*File|str*/f)
    //--------------------------------------
    {
        var s = null;
    
        if( f && (f = new File(f)) && (f.encoding='BINARY') && f.open('r') )
            {
            s = f.read();
            f.close();
            }
    
        return s && base64Encode(s);
    };
    
    // Client code
    // ---
    var b64 = fileToBase64("my/path/to/image.jpg");
    

    @+

    Marc

  • Big base64 that image cannot be correctly converted to BLOB

    I use the script below to extract the JSON in MongoDB, analyze and then inserting it into an Oracle table.

    • The script works very well in a way that it inserts all the values correctly in the Oracle table. That includes the picture value, which is a base64 image formats and it is much longer than 32 KB.
    • The Photo column in the Appery_Photos table is of type CLOB, while the DecodedPhoto column is of type BLOB.
    • The problem lies in the line blobOriginal: = base64decode1 (Photo); line 24 , I used to decode the CLOB in BLOB. The base64decode1 function has been replaced by several functions (e.g. decode_base64 , base64DecodeClobAsBlob_plsql, base64decode , from_base64 & finally JSON_EXT. DECODER the). 
    • The result was the same for each of them. In other words, the BLOB that results cannot be opened as an image using image editors (I use Oracle SQL Developer to download).
    • I checked CLOB, and I couldn't find returns in line * \n*, nor could I find spaces (only + found signs). Furthermore, I inserted the CLOB value into base64-image-converter , and the image is displayed correctly. In addition, I tried to encode the BLOB that results in base64 back in order to further validate (by using the inverse functions provided in the links above), the resultant base64 is not the same as the original at all.

    BEGIN
          l_http_request := UTL_HTTP.begin_request('https://api.appery.io/rest/1/db/collections/Photos?where=%7B%22Oracle_Flag%22%3A%22Y%22%7D' , 'GET' , 'HTTP/1.1');
          -- ...set header's attributes
          UTL_HTTP.set_header(l_http_request, 'X-Appery-Database-Id', '53f2dac5e4b02cca64021dbe');
          l_http_response := UTL_HTTP.get_response(l_http_request);
          BEGIN
            LOOP
              UTL_HTTP.read_text(l_http_response, buf);
              l_response_text := l_response_text || buf;
            END LOOP;
          EXCEPTION
          WHEN UTL_HTTP.end_of_body THEN
            NULL;
          END;
          l_list := json_list(l_response_text);
          FOR i IN 1..l_list.count
          LOOP
            A_id  := json_ext.get_string(json(l_list.get(i)),'_id');
            l_val := json_ext.get_json_value(json(l_list.get(i)),'Photo');
            dbms_lob.createtemporary(Photo, true, 2);
            json_value.get_string(l_val, Photo);
            dbms_output.put_line(dbms_lob.getlength(Photo));
            dbms_output.put_line(dbms_lob.substr(Photo, 20, 1));
            blobOriginal := base64decode1(Photo);
            A_Name       := json_ext.get_string(json(l_list.get(i)),'Name');
            Remarks      := json_ext.get_string(json(l_list.get(i)),'Remarks');
            Status       := json_ext.get_string(json(l_list.get(i)),'Status');
            UserId       := json_ext.get_string(json(l_list.get(i)),'UserId');
            A_Date       := json_ext.get_string(json(l_list.get(i)),'Date');
            A_Time       := json_ext.get_string(json(l_list.get(i)),'Time');
            MSG_status   := json_ext.get_string(json(l_list.get(i)),'MSG_status');
            Oracle_Flag  := json_ext.get_string(json(l_list.get(i)),'Oracle_Flag');
            acl          := json_ext.get_string(json(l_list.get(i)),'acl');
          INSERT
            INTO Appery_Photos
              (
                A_id,
                Photo,
                DecodedPhoto,
                A_Name,
                Remarks,
                Status,
                UserId,
                A_Date,
                A_Time,
                MSG_status ,
                Oracle_Flag,
               acl
              )
              VALUES
              (
                A_id,
                Photo,
                blobOriginal,
                A_Name,
                Remarks,
                Status,
                UserId,
                A_Date,
                A_Time,
                MSG_status ,
                Oracle_Flag,
                acl
              );
            dbms_lob.freetemporary(Photo);
          END LOOP;
          -- finalizing
          UTL_HTTP.end_response(l_http_response);
        EXCEPTION
        WHEN UTL_HTTP.end_of_body THEN
          UTL_HTTP.end_response(l_http_response);
        END;
    
    

    Any help is deeply appreciated.

    After I run this I can see your photos. So you're a fan of Winston

    Please note the substr I used on the clob Photo.

    declare
    tmp blob.
    function clobbase642blob (p_clob clob)
    Returns the BLOB
    is
    t_blob blob.
    t_buffer varchar2 (32767).
    number of t_pos: = 1;
    number of t_size: = nls_charset_decl_len (32764, nls_charset_id ("char_cs"));
    number of t_len;
    t_tmp raw (32767).
    Start
    DBMS_LOB.CREATETEMPORARY (t_blob, true);
    t_len: = length (p_clob);
    loop
    When the t_pos output > t_len;
    t_buffer: = replace (replace (substr (p_clob, t_pos, t_size), Chr (10)), Chr (13));
    t_pos: = t_pos + t_size;
    all in t_pos <= t_len="" and="" mod(="" length(="" t_buffer="" ),="" 4="" )="">0
    loop
    t_buffer: = t_buffer | Replace (replace (substr (p_clob, t_pos, 1), Chr (10)), Chr (13));
    t_pos: = t_pos + 1;
    end loop;
    t_tmp: = utl_encode.base64_decode (utl_raw.cast_to_raw (t_buffer));
    DBMS_LOB. WriteAppend (t_blob, utl_raw.length (t_tmp), t_tmp);
    end loop;
    Return t_blob;
    end;
    Start
    for in r_x (select A_id, photo of Appery_Photos for update)
    loop
    tmp: = clobbase642blob (substr (r_x.photo, 24));
    x update
    Set DecodedPhoto = tmp
    where A_id = r_x.A_id;
    end loop;
    end;

  • image file conversion to string base64encoding

    I tried conveting image base64 encoding stirng to send to the server... I am able to retrieve the file path with success using the file picker, but there are concerns the conversion of image to a string. I used base64outputstream n all that kind of stuff... But sometimes they work, sometimes they used... I want to have a snippet of code that performs my task... Some1 can help me?

    I suggest the developers who are coding of the image to resize the programitically image before encoding... This will allow to reach the time of 99 / 100 task coding ...

  • How to convert a Blob to String? Hi all

    How to convert a Blob to String? Hi all

    currentRow.getAttribute ("TemplateFile"); TemplateFile is file blob...

    I want to convert...

    What is the data type of the TemplateFile in the VO... or VORowImpl... is - this String?... If so it changes of type Blob...

  • vCenter Converter 4.1 - using an Acronis True Image 9.1 image file, error

    I posted this question in the wrong forum... I think so. So I'll post it here where I think is appropriate...

    http://communities.VMware.com/message/1662417#1662417

    I get the error message...

    "The machine virtual source is not recognized.

    I am using vCenter 4.1 standalone on a helper VM. I use Acronis True Image 9.1 to create the backup image, and he pointed out that image was created successfully. I restarted the server and creates a new image and I get the same thing. I created another image, do NOT use a shadow copy volume and the same thing. I created another image WITH shadow copy volume and the same thing.

    For a validation test, I created another image from another SQL Server and it works fine. For some reason any this particular SQL Server keeps giving me the same error.

    I'm backup of SQL server is an HP DL380 G3 physical and ESX ESX 3.5 U5 infrastructure if it means something... lol

    Any ideas?

    EDIT:

    FYI, the HP DL 380 SQL Server running Windows Server 2003 x 32 SP2

    UPDATE:

    I just upgraded to vCenter Converter 4.3 and now I get the following error message...

    "The source settings are invalid.

    So I did another test of consistency and tried to restore using Acronis and Acronis reads the file .tib without problem.

    restore the tib to a virtual machine created in the same way as you would with a real computer.
    Boot CD Acronis and load the tib of the network...

    During the creation of the new brand VM that yoy use buslogic scsi-controller.

    scsi0.virtualDev = "buslogic".

    When did race against the newly created - virtual computer converter specify the vmx file and use the option "set up the machine" of the converter

  • Image file of reading BLOB and the opening on the side customer

    Dear all,
    I have a table of database with a BLOB data type field and there are files TIFF stored in this column.

    I want to open this file on desktop of the client as Tiff soon he call a PL/SQL procedure?

    How built-ins or methods, I can use?

    Thanks in advance!

    Kind regards
    Ali

    As an example of a PL/SQL procedure image file, the following procedure for web enabled (called via Apache and using the module of Apache Oracle mod_plsql ) returns an image.

    create or replace procedure TIFFimage( fileName varchar2 ) is
      b blob;
    begin
      -- read the TIFF blob from image table
      select p.file into b from my_tiff_files p where p.file_name = fileName;
    
      -- create the HTTP response header for the browser
      OWA_UTIL.mime_header( 'image/tiff', FALSE );
      HTP.p( 'Content-Disposition: attachment; filename='||fileName );
      HTP.p( 'Content-Length: ' || DBMS_LOB.getlength(b) );
      OWA_UTIL.http_header_close;
    
      -- stream the content using Oracle's Web Procedural Gateway interface
      WPG_DOCLOAD.download_file( b );
    end;
    

    In this case, the customer will be a web browser. It will use the URL will look something like this:

    http://my-web-server.my-domain.com/pls/TIFFimage?fileName=PrettyPicture.tiff
    

    No need for intermediate files. PL/SQL procedure creates a HTTP from MIME response that contains the image - something that the client (web browser in this case) understand and fully support.

    The same principle applies to any other type of client - he called SQL or PL/SQL - it gets a response - this process / makes this answer.

  • Image file in DB entry does not

    I try to have the user select an image file, and then insert into a db however I get this db error "entity line with null key is not found in NblNhIncsubmission."

    If you see my picture below you can see my code is correctly downloaded the file and update the "Attachment" field, but it throws an error inserting the entire form in the db

    Here's the PB I need to insert in (circled is the column I'm inserting the NblNhIncsubmission DB)

    Here is my page jspx code:

    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <jsp:directive.page contentType="text/html;charset=UTF-8"/>
      <f:view>
        <af:document id="d1" binding="#{backingBeanScope.backing_Test.d1}">
          <af:messages binding="#{backingBeanScope.backing_Test.m1}" id="m1"/>
          <af:form id="f1" binding="#{backingBeanScope.backing_Test.f1}"
                   usesUpload="true">
            <af:pageTemplate viewId="/oracle/templates/threeColumnTemplate.jspx"
                             id="pt1">
              <f:facet name="center">
                <af:panelFormLayout binding="#{backingBeanScope.backing_Test.pfl1}"
                                    id="pfl1">
                  <af:spacer width="10" height="10"
                             binding="#{backingBeanScope.backing_Test.s2}" id="s2"/>
                  <af:inputDate value="#{bindings.When.inputValue}" label="WHEN"
                                shortDesc="#{bindings.When.hints.tooltip}"                        
                                id="it6" required="true" showRequired="true"/>
                  <af:spacer width="10" height="10"
                             binding="#{backingBeanScope.backing_Test.s1}" id="s1"/>
                  <af:selectOneChoice value="#{bindings.Location.inputValue}"
                                      label="LOCATION"
                                      shortDesc="What is your location?"
                                      binding="#{backingBeanScope.backing_Test.soc1}"
                                      id="soc1" showRequired="true" required="true">
                    <f:selectItems value="#{bindings.Location.items}"
                                   binding="#{backingBeanScope.backing_Test.si1}"
                                   id="si1"/>
                  </af:selectOneChoice>
                  <af:spacer width="10" height="10"
                             binding="#{backingBeanScope.backing_Test.s3}" id="s3"/>
                  <af:selectOneChoice value="#{bindings.Category.inputValue}"
                                      label="OBSERVATION TYPE"
                                      shortDesc="Describe the cause of your observation."
                                      binding="#{backingBeanScope.backing_Test.soc2}"
                                      id="soc2" required="true" showRequired="true">
                    <f:selectItems value="#{bindings.Category.items}"
                                   binding="#{backingBeanScope.backing_Test.si2}"
                                   id="si2"/>
                  </af:selectOneChoice>
                  <af:spacer width="10" height="10"
                             binding="#{backingBeanScope.backing_Test.s4}" id="s4"/>
                  <af:inputText value="#{bindings.Details.inputValue}"
                                label="YOUR OBSERVATION"
                                columns="#{bindings.Details.hints.displayWidth}"
                                maximumLength="#{bindings.Details.hints.precision}"
                                shortDesc="#{bindings.Details.hints.tooltip}"
                                binding="#{backingBeanScope.backing_Test.it3}"
                                id="it3" required="true">
                    <f:validator binding="#{bindings.Details.validator}"/>
                  </af:inputText>
                  <af:spacer width="10" height="10"
                             binding="#{backingBeanScope.backing_Test.s5}" id="s5"/>
                  <af:inputText value="#{bindings.Action.inputValue}"
                                label="ACTION TAKEN"
                                columns="#{bindings.Action.hints.displayWidth}"
                                maximumLength="#{bindings.Action.hints.precision}"
                                shortDesc="#{bindings.Action.hints.tooltip}"
                                binding="#{backingBeanScope.backing_Test.it4}"
                                id="it4" showRequired="true" required="true">
                    <f:validator binding="#{bindings.Action.validator}"/>
                  </af:inputText>
                  <af:spacer width="10" height="10"
                             binding="#{backingBeanScope.backing_Test.s6}" id="s6"/>
                  <af:inputText value="#{bindings.Attachment.inputValue}"
                                label="#{bindings.Attachment.hints.label}"
                                required="#{bindings.Attachment.hints.mandatory}"
                                columns="#{bindings.Attachment.hints.displayWidth}"
                                maximumLength="#{bindings.Attachment.hints.precision}"
                                shortDesc="#{bindings.Attachment.hints.tooltip}"
                                binding="#{backingBeanScope.backing_Test.it2}"
                                id="it2" rendered="true">
                    <f:validator binding="#{bindings.Attachment.validator}"/>
                  </af:inputText>            
                  <af:spacer width="10" height="10"
                             binding="#{backingBeanScope.backing_Test.s8}" id="s8"/>
                  <af:inputFile label="Upload File"
                                binding="#{backingBeanScope.backing_Test.if1}"
                                id="if1"
                                value="#{backingBeanScope.backing_Test.file}"/>
                  <af:panelLabelAndMessage label="SUBMITTED BY:"
                                           binding="#{backingBeanScope.backing_Test.plam1}"
                                           id="plam1">
                    <af:outputText value="#{securityContext.userName}"
                                   binding="#{backingBeanScope.backing_Test.ot1}"
                                   id="ot1"/>
                  </af:panelLabelAndMessage>
                  <af:inputText value="#{bindings.Userid.inputValue}"
                                label="#{bindings.Userid.hints.label}"
                                required="#{bindings.Userid.hints.mandatory}"
                                columns="#{bindings.Userid.hints.displayWidth}"
                                maximumLength="#{bindings.Userid.hints.precision}"
                                shortDesc="#{bindings.Userid.hints.tooltip}"
                                binding="#{backingBeanScope.backing_Test.it1}"
                                id="it1" rendered="false">
                    <f:validator binding="#{bindings.Userid.validator}"/>
                  </af:inputText>
                  <af:panelGridLayout binding="#{backingBeanScope.backing_Test.pgl1}"
                                      id="pgl1">
                    <af:gridRow marginTop="5px" marginBottom="5px" height="auto"
                                binding="#{backingBeanScope.backing_Test.gr1}"
                                id="gr1">
                      <af:gridCell marginStart="5px" width="auto"
                                   binding="#{backingBeanScope.backing_Test.gc1}"
                                   id="gc1">
                        <af:commandButton
                                          text="Submit"
                                          disabled="#{!bindings.Commit.enabled}"
                                          binding="#{backingBeanScope.backing_Test.cb2}"
                                          id="cb2"
                                          action="#{backingBeanScope.backing_Test.cb2_action}"/>
                      </af:gridCell>
                      <af:gridCell marginStart="1px" width="auto"
                                   binding="#{backingBeanScope.backing_Test.gc2}"
                                   id="gc2">
                        <af:commandButton text="Cancel"
                                          binding="#{backingBeanScope.backing_Test.cb4}"
                                          id="cb4"
                                          partialTriggers="pfl1" disabled="true"/>
                      </af:gridCell>
                    </af:gridRow>
                  </af:panelGridLayout>
                  <af:panelGridLayout binding="#{backingBeanScope.backing_Test.pgl2}"
                                      id="pgl2">
                    <af:gridRow marginTop="5px" marginBottom="5px" height="auto"
                                binding="#{backingBeanScope.backing_Test.gr2}"
                                id="gr2">
                      <af:gridCell marginStart="5px" width="auto"
                                   binding="#{backingBeanScope.backing_Test.gc5}"
                                   id="gc5">
                        <af:resetButton text="Clear All"
                                        binding="#{backingBeanScope.backing_Test.rb1}"
                                        id="rb1"/>
                      </af:gridCell>
                      <af:gridCell marginStart="1px" marginEnd="5px" width="auto"
                                   binding="#{backingBeanScope.backing_Test.gc6}"
                                   id="gc6">
                        <a href="mailto:noharinc.com?subject=NO HARM Observation Feedback">Mail</a>
                      </af:gridCell>
                    </af:gridRow>
                  </af:panelGridLayout>
                  <f:facet name="footer">
                  </f:facet>
                </af:panelFormLayout>
              </f:facet>
              <f:facet name="header"/>
              <f:facet name="end"/>
              <f:facet name="start">
                <af:group binding="#{backingBeanScope.backing_Test.g1}" id="g1">
                  <af:decorativeBox binding="#{backingBeanScope.backing_Test.db1}"
                                    id="db1" topHeight="180px">
                    <f:facet name="center"/>
                    <f:facet name="top">
                      <af:image source="/[email protected]" shortDesc="NoHarmLogo"
                                binding="#{backingBeanScope.backing_Test.i1}"
                                id="i1"/>
                    </f:facet>
                  </af:decorativeBox>
                </af:group>
              </f:facet>
              <f:facet name="branding"/>
              <f:facet name="copyright"/>
              <f:facet name="status"/>
            </af:pageTemplate>
          </af:form>
        </af:document>
      </f:view>
      <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_Test-->
    </jsp:root>
    
    
    
    

    Here is my java code snippet:

    //Method to create blobdomain from selected file
        private BlobDomain createBlobDomain(UploadedFile file) {
            InputStream in = null;
            BlobDomain blobDomain = null;
            OutputStream out = null;
            try {
                in = file.getInputStream();
                blobDomain = new BlobDomain();
                out = blobDomain.getBinaryOutputStream();
                byte[] buffer = new byte[8192];
                int bytesRead = 0;
                while ((bytesRead = in.read(buffer, 0, 8192)) != -1) {
                    out.write(buffer, 0, bytesRead);
                }
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            } catch (SQLException e) {
                e.fillInStackTrace();
            }
            return blobDomain;
        }
    
    //Action lsitener for submit button
        public String cb2_action() {
            BindingContainer bindings = getBindings();    
            OperationBinding operationBinding = bindings.getOperationBinding("Commit");  
            //Grab the file
            UploadedFile myfile = (UploadedFile)this.getFile();
    
            //Set the Attachment InputText field value to the blob domain generated
            FacesContext facesCtx = FacesContext.getCurrentInstance();
            Application app = facesCtx.getApplication();
            ExpressionFactory elFactory = app.getExpressionFactory();
            ELContext elContext = facesCtx.getELContext();
            ValueExpression ve = elFactory.createValueExpression(elContext, "#{bindings.Attachment.inputValue}",Object.class);
            //set the Attachment value to the blobdomain contents before inserting into db
            ve.setValue(elContext,createBlobDomain(myfile));
          
            //Commit input into Database     
            Object result = operationBinding.execute();     
            if (!operationBinding.getErrors().isEmpty()) {
                return null;
            }
          
            //Display popup message
            FacesContext con = FacesContext.getCurrentInstance();
            FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO,"Thank you for submitting your observation.","");
            con.addMessage("",message);
          
            return null;
        }
    
    
    

    haha OMG finally got it to work thanks @Timo Hahn (idk why didn't you tag) and Cvele_new_account

    After reading comments Timo again and blog and wire with cvele comment

    Solution was to make sure my update of bindings is set correctly, then check the "Insert" for updating the after:

  • PDF to Image file

    Hello

    I would like to ask if it is possible to use LabVIEW to convert PDF files into image files? or more precisely, the PNG files.

    Or are there resources/links that provides sufficient information on the PDF format so that you can use LabVIEW to make certain quantities and get a picture/photo card?

    Enjoy one advises.

    Thank you for your kind attention.

    Rgds

    Once, I posted a VI to create LaTeX commands PNG files I used Ghostscript to convert the EPS to png.  It turns out, with only a very slight modification the Subvi will also convert PDF to PNG.  Try this out.  You can install Ghostscript and then add the path to gswin32c.exe for trajectory control (if you install to the default location, you shouldn't have to change anything else than to the drive letter).

    http://pages.cs.wisc.edu/~ghost/

  • How to convert binary data from the Panel controls in ASCII values?

    Hello

    I seemed to face a roadblock with how to convert binary values in ascii.

    I created this .vi to save all control values in an .ini file and call them at that time where I will carry out the .vi as shown in the file attached. Registration key to simply save the data and Cancel button discards all current changes.

    I would like to understand how to retrieve all the values of control to ASCII, so I assign to a global variable for later use. I've looked everywhere for a good reference document, and I couldn't find one that would explain my question. I would be greatly appreciated if someone could point me in the right direction.

    Thank you

    Sam

    I tried a simple way to save control values in the front panel

    Not reinventing the wheel, when there are ready to use of solutions, for example:

    http://sine.NI.com/NIPs/CDs/view/p/lang/en/NID/209753

    Use the MGI save & restore settings VI of the palette (for example, it records all the settings that have been changed in a graph, which is very useful) and the MGI Save (restoration) Front Panel data live (to save and restore control values in the front panel).

    Here is an example:

  • Scan convert ms word (.doc) file.

    Is there any software by which I can convert my scanned images (text) to the ms word doc (.doc) file?

    Hello

     
    Some scanners have the ability to convert the image to text, check your scanner manual for the exact procedure. You can also use your search engine preferred for a tool to convert.
     
    Warning: Using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.
  • HP Envy 5534: Envy 5534 on MAC-printing error message Impossible to convert the scrip post file

    New printer configured prints letter but when I want to print a page with barcode on get error message: -.

    print the error message could not convert the scrip post file

    Can someone help please

    Hello

    Good news - after the first print as Image and wait for about 15 minutes as the printer thought of printing it - I had attempt additional ater restart and now it is printing the past I downloaded through Adobe Acrobat

  • How to convert the Bitmap Image in BlackBerry

    Hello

    In my application, I get the picture from the server. Now, I want to convert this Bitmap Image to display on the screen. For this I use below codes. But it doesn't give me the same image does not mean with the clarity and the exact size. He's smaller than the picture.

    I used the codes below:

    private Bitmap getBitmapFromImg(Image img) {
            Bitmap bmp = null;
            try {
                Logger.out(TAG, "It is inside the the image conversion        " +img);
                Image image = Image.createImage(img);
                byte[] data = BMPGenerator.encodeBMP(image);
                Logger.out(TAG, "It is inside the the image conversion---333333333"+data);
                bmp = Bitmap.createBitmapFromBytes(data, 0, data.length, 1);
                } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            return bmp;
            // TODO Auto-generated method stub
        }
    

    Here is the BMPGenerator class:

    public final class BMPGenerator {
    
            /**
             * @param image
             * @return
             * @throws IOException
             * @see {@link #encodeBMP(int[], int, int)}
             */
            public static byte[] encodeBMP(Image image) throws IOException {
                    int width = image.getWidth();
                    int height = image.getHeight();
                    int[] rgb = new int[height * width];
                    image.getRGB(rgb, 0, width, 0, 0, width, height);
                    return encodeBMP(rgb, width, height);
            }
    
            /**
             * A self-contained BMP generator, which takes a byte array (without any unusual
             * offsets) extracted from an {@link Image}. The target platform is J2ME. You may
             * wish to use the convenience method {@link #encodeBMP(Image)} instead of this.
             * 

    * A BMP file consists of 4 parts:- *

      *
    • header
    • *
    • information header
    • *
    • optional palette
    • *
    • image data
    • *
    * At this time only 24 bit uncompressed BMPs with Windows V3 headers can be created. * Future releases may become much more space-efficient, but will most likely be * ditched in favour of a PNG generator. * * @param rgb * @param width * @param height * @return * @throws IOException * @see http://en.wikipedia.org/wiki/Windows_bitmap */ public static byte[] encodeBMP(int[] rgb, int width, int height) throws IOException { int pad = (4 - (width % 4)) % 4; // the size of the BMP file in bytes int size = 14 + 40 + height * (pad + width * 3); ByteArrayOutputStream bytes = new ByteArrayOutputStream(size); DataOutputStream stream = new DataOutputStream(bytes); // HEADER // the magic number used to identify the BMP file: 0x42 0x4D stream.writeByte(0x42); stream.writeByte(0x4D); stream.writeInt(swapEndian(size)); // reserved stream.writeInt(0); // the offset, i.e. starting address of the bitmap data stream.writeInt(swapEndian(14 + 40)); // INFORMATION HEADER (Windows V3 header) // the size of this header (40 bytes) stream.writeInt(swapEndian(40)); // the bitmap width in pixels (signed integer). stream.writeInt(swapEndian(width)); // the bitmap height in pixels (signed integer). stream.writeInt(swapEndian(height)); // the number of colour planes being used. Must be set to 1. stream.writeShort(swapEndian((short) 1)); // the number of bits per pixel, which is the colour depth of the image. stream.writeShort(swapEndian((short) 24)); // the compression method being used. stream.writeInt(0); // image size. The size of the raw bitmap data. 0 is valid for uncompressed. stream.writeInt(0); // the horizontal resolution of the image. (pixel per meter, signed integer) stream.writeInt(0); // the vertical resolution of the image. (pixel per meter, signed integer) stream.writeInt(0); // the number of colours in the colour palette, or 0 to default to 2n. stream.writeInt(0); // the number of important colours used, or 0 when every colour is important; // generally ignored. stream.writeInt(0); // PALETTE // none for 24 bit depth // IMAGE DATA // starting in the bottom left, working right and then up // a series of 3 bytes per pixel in the order B G R. for (int j = height - 1; j >= 0; j--) { for (int i = 0; i < width; i++) { int val = rgb[i + width * j]; stream.writeByte(val & 0x000000FF); stream.writeByte((val >>> 8) & 0x000000FF); stream.writeByte((val >>> 16) & 0x000000FF); } // number of bytes in each row must be padded to multiple of 4 for (int i = 0; i < pad; i++) { stream.writeByte(0); } } byte[] out = bytes.toByteArray(); bytes.close(); // quick consistency check if (out.length != size) throw new RuntimeException("bad math"); return out; } /** * Swap the Endian-ness of a 32 bit integer. * * @param value * @return */ private static int swapEndian(int value) { int b1 = value & 0xff; int b2 = (value >> 8) & 0xff; int b3 = (value >> 16) & 0xff; int b4 = (value >> 24) & 0xff; return b1 << 24 | b2 << 16 | b3 << 8 | b4 << 0; } /** * Swap the Endian-ness of a 16 bit integer. * * @param value * @return */ private static short swapEndian(short value) { int b1 = value & 0xff; int b2 = (value >> 8) & 0xff; return (short) (b1 << 8 | b2 << 0); }

    Where an error in my code? Is there another way to do the same thing?

    Why you want to use a bmp image?
    You can just use png, jpg or whatever of the original image is.
    If there is a situation where you need the bitmap image call http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/system/EncodedImage.html#getBi...

  • size of the image file

    Hi all

    I have an application that includes the photo module. I use under encoding settings:

    String encoding = "encoding = jpeg & width = 1024 & height = 768 & quality = normal;

    The problem is the image size. For the same scene when I use 9780 it is approximately 350KB for 9800, it is only 80KB. Can someone please explain the reason for this difference?

    Y at - it no additional or other adjustment means that I can use to reduce the size of the file for 9780? (physical size 1024 * 768 should not be changed).

    Thank you.

    Could not find any additional setting. I used the method to reduce the image quality and therefore the size of the image file without changing the resolution of the image below.

    JPEGEncodedImage.encode (bitmap, QUALITY);

Maybe you are looking for

  • Screensaver Question

    Used your family photos for the screen saver more Apple TV. I used the "Photo Wall" selection. Now on the latest Apple TV, I can't find the "Photo wall". It is no longer available? Is there a way to get that selection?

  • 4S suddenly turned off. Will not feed.

    iPhone 4 16GB.  Just finished a MacBook backup.  Ejected iPhone 4S Mac.  Unplugged 4 USB and s iPhone went to black screen.  Cannot turn it on.  During the walk back, discovered the iPhone 4S has been updated and no update is available.

  • Cannot save, cancel the registration, remove the app from my dashboard

    Hello I'm unable to register, unregister my sony dashboard. in the Web page, I select the dashboard, select delete and nothing happen, in the dashboard, the same problem

  • Get the message "error 5: access is denied."

    I have exactly the same problem. I tried all of the following conditions: 1. check what activity files & network is performed when you try to start the service. Nothing substantial found. 2. change the login of the service account. Has not resolved t

  • Microsoft Antivirus 2009 Web Scanner - legitimate?

    De : Billy K Question: "A couple of times in the last two days, I get a Microsoft Antivirus 2009 Web Scanner" message, telling me that I have Trojan virus and download a program to get rid of him. is it legitimate?--Willy K