How to decode and display jpeg from a bytes stream ?

Hello.
I am new to Flex and got stuck on something that I assume has an easy solution.
I have an RIA application in which I want to display a jpeg image. this image was
sent on a Web Service message,  as an array of bytes (I just read the jpeg file as
is and send it to the web application).
I couldn't figure out a way to decode and display this image at the RIA, using an apropriate component. (Image ?)
I have seen a few examples where a jpg is loaded from a web server using a url in
which it's avaliable, but I don't think this is much help to me...
Your help/example apreciated.

Thanks.
I assume you mean passing the bytesArray to Image.load() ?
Anyway, that's what I did and it worked fine.
Now I am facing the same issue with playing sounds, which are available on bytesArray.
I tried to pass the mp3 bytes to the Sound.load(), but it doesn't work, becuase it tries
to cast it to a URL. do you know by any chance  whether I can achieve that somehow ?
(I could use prety much any other sound format, if it makes a difference)
Thanks again.

Similar Messages

  • Help, how to open and display blobs from tables

    Dear all,
    I am trying to store ms-word files on a table using a blob column.
    Does anyone how to open the files and display them from a form using 9iAS?
    Thank you.
    Carlos.

    And there may be, but you won't likely find that here. Do some time searching Google and maybe you'll find code that someone was nice enough to make freely available, although I wouldn't count on it. Were i a programmer and took the time to read those docs and write the code, I'd want to be paid for my time. But there are a lot of programmers who swear by freeware! You may get lucky.

  • How to acquire and display data from labview to excel simultaneo​usly

    hello,
    I am using the NI-DAQ to measure the falling edges of a clock and display them into a table. What I need is to display these data in a table in excel while the program is running. In addition, when I receive a pulse from an external clock, for which I have created a digital channell, the data must be logged in a different column. In other words, every time I receive a pulse the data must be stored in the adjacent column in excel.

    Hello Evangelos,
    As far as I know and have experienced, it is not possible to access a spreadsheet file (or any file, for that matter) by two programs at the same time, you will get an error.
    Also, a couple of observations on your code:
    A constant wired to a case selector of a case structure makes no sense as the false case will never be executed.
    Move the DAQmx Read from your Digital Input task into the while loop, as the DAQmx Read will only read once and the wire won’t get information in or out of a while loop as long as the while loop is iterating.
    Regards,
    Daniel REDS
    RF Systems Engineer
    Help us grow.
    If a post solves your question, mark it as The Solution.
    If a post helps, give Kudos to it.

  • How to store and display Response from REST Service

    Hi,
    My WADL has defined the response that my REST service returns back as below :
    <object name="Get_Root">
            <property name="RequestId" type="number" />
            <property name="Name" type="string" />
            <property name="fromPlace" type="string" />
            <property name="toPlace" type="string" />
            <property name="fromDate" type="string" />
            <property name="toDate" type="string" />
    </object>
    I want to store this response; response is a single entry of the above type and not a collection (I am making the request on a button click) and then display it on the screen in multiple labels.
    How can I do this? Will I have to use a collection and a gallery, even though I have a single response?
    Thanks,
    Pragya

    Okay.. got it. So MyRestData has a Get function taking some n arguments and it responds back with an object of the type I had mentioned before.
    From what I understood, I have to write the below code for each label
    MyRestData!Get(.....)!Name
    MyRestData!Get(.....)!fromPlace
    MyRestData!Get(.....)!toPlace ...and so on
    Wouldn't that translate to different REST calls? Is there a way to get and store the entire response object
    in the app and access each of its properties/subelements locally?
    Also when you wrote the below before
    Text: "The name is: " &  MyRestData!Get_Root!Name
    it seems that I can access the response object Get_Root using MyRestData. This is not the case for me. MyRestData only lets me access the Get function using "!", and not the response object in any way.
    Thanks for your help!

  • How to retrieve and display image from database in a web page

    Hi all;
    I have been trying this for some time now. I have found some tutorials so far but none of them addresses my concern. Here it is:
    I have built a web application that can connect to an Oracle DB.
    I have a table called "employee", where I record any employee details, among which the employee picture. I stored the pictures and the finger prints using "Oracle sql developper" as blob type.
    How can i retrieve and view all these information when i run the application?
    I can easily retrieve all other types of value, but the image(BLOB type) has been a nightmare for me.
    HELP PLEASE.

    morgalr wrote:
    I believe your Binary Large Obejct will come back as an array of int, and you'll need to use BufferedImage it's associated API to get it to a viewable image configuration.I don't think BufferedImage immediately solves the problem -- this is a web app, so I assume the image will be displayed using the HTML IMG tag.
    Solution: google. There are many example of how to do this. For example, any book on servlets will have an example of dishing up a dynamic image.

  • How to control and display video from IP camera using ActiveX control over Internet.

    Hello,
    I need to control my IP cameras over the internet. I need to log into the cameras and then display the video.  There's an ActiveX control registered on the computer and works fine with IE to access and control the cameras. Controlling the cameras using IE works fairly well, but there are some quirks that I'd like to eliminate by using my own custom code.
    Has anyone created a vi that controls a Foscam FI8905W over the Internet? I’ve attempted, but I keep getting a catastrophic failure when I try to call ManagementConnect Method in the DVM_IPCam2 ActiveX Control Module V1.0. I'm not sure whether I need to establish an IP connection with the cameras first, or allow the ActiveX control to establish it for me.
    Some example code would be greatly appreciated. Running LabVIEW 2011 on a Win7 32bit.  Even some code used to control a similar device using ActiveX over Internet would be helpful.

    I have an example vi for interfacing to the foscam activex.
    I plan on using mouse click events within the activex window to trigger the PT function.
    I only have the basic up/down/right/left directions and not the down-right/down-left/up-right/up-left in the enum.  You can load the camera's web page and view the source to see the Java script code that uses the activex control.  There are definitions for the other directions.
    I had to mark the control as "Disabled" to keep click events from going to the activex control.  If I double click the control, it goes full screen.  If I then click on it to get out of full screen mode the video never returns or returns to the wrong spot in the VI.
    Attachments:
    Foscam Demo.vi ‏24 KB

  • How to decode and display the PDF in ADF application

    Hi All,
    I newbie to Oracle ADF,my requirement is like, In DB table encoded pdf data is available I am able to view the the encodes data in ADF app but I want to decoded pdf. In my app I decoded the encoded data but it comes as text format like' %PDF-1.4
    2 0 obj
    <<
    /CreationDate (D:20121017234301)
    /Keywords <>
    /Author ()' I looking for actual pdf format. Any help.
    Thanks
    Mani

    It would be helpful if you describe what did not work with the sample. The sample reads the pdf from a file whereas you need to load it from a blob in the DB.
    You can use my sample, which need some setup, so don't run it as is, http://tompeez.wordpress.com/2013/05/16/handling-imagesfiles-in-adf-part-4/ which shows how to do this with blobs read from the db.
    Timo

  • Displaying jpegs from folder

    Hi,
    I would like to display jpegs from a folder, and be able to somehow scroll through them?
    So far i have been able to display them by using listfolder and linking it to a for loop containing readjpeg, but this basically creates a slideshow of jpegs. I would like to control which jpeg is being displayed by having 2 buttons, one to go through the pictures, and one to go backwards. .
    I hope this makes sense, I'm new to LabVIEW.
    Any help would be greatly appreciated!
    Attachments:
    VIEW_JPEG.vi ‏14 KB

    here is one simple possibility. 'hope it make sense.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    VIEW_JPEG_MOD.vi ‏22 KB

  • How to place an image in database and how to retrieve and display it in the front end

    how to place an image in database and how to retrieve and display it in the front end
    and to place an image in database and retrieve the image from database using xml
    please,help me out.

    Create a table with a Long RAW Datatype column for storing the Image Column Data.
    Create the form based on the table , which by defaults the column with LONG RAW atatype to a Image Item.
    You can use Forms Built in function READ_IMAGE_FILE to read a Image file stored on the file system in to the image item.
    A save on the form saves the image in the Image item in the long raw column.

  • How to Generate and Display SVG Graphics in ABAP

    Hi everybody,
    I tried to complete the Tutorial "How to Generate and Display SVG Graphics in ABAP, Part 1" by Siarhei Ulasenka (https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/ad83a990-0201-0010-d680-a189f8bc20fa).
    Unfortunately when I tried the example to display an SVG Drawing in an ABAP Report I get the error message "Es ist ein Laufzeitfehler aufgetreten, ungültiges Zeichen" (english should be something like "Runtime Error, unkown character"). But it works when I open the svgfile in a new IE Window (parameter in_place from cl_gui_html_viewer->show_url). Also when I open a svg file from the local disc it works fine.
    The code:
        CALL METHOD html_control->load_data
          EXPORTING
            url            = 'chart.svg'
            type         = 'image'
            subtype    = 'svg+xml'
          CHANGING
            data_table = lt_svg
          EXCEPTIONS
            OTHERS     = 1.
        CALL METHOD html_control->show_url
          EXPORTING
            url        = 'chart.svg'
            in_place   = 'X'
          EXCEPTIONS
            cntl_error = 1.
    Has anyone a solution? Thanks in advance for your help!
    Regards
    Kathrin

    Hello Alex,
    The Corel SVG viewer has problems loading and displaying the examples (see the list of limitations at their site). Try to use the Adobe viewer instead.
    Regards,
    Sergei Ulasenka

  • How to acces and display datas storaged in cache for a SUP 2.0 workflow?

    HI to all.
    I have an application with a item menu which obtains data thought a online request. the result is shown is a listview.
    My problem is when my BlackBerry has no conection ( offline scenario). When I select the menu item, I obtain an error.
    How to acces and display datas storaged in cache for my MBO? I have read that I can use getMessageValueCollection in custom.js to access to my datas but once I get the datas, How can associate those datas to a Listview like a online request?? Do i have to develop my own screen in html or how?
    Thanks.

    I'm not entirely clear on what you mean by "cache" in this context.  I'm going to assume that what you are really referring to is the contents of the workflow message, so correct me if I'm wrong.  There is, in later releases, the ability to set an device-side request cache time so that if you issue an online request it'll store the results in an on-device cache and if you subsequently reissue the same online request with the same parameter values within that timeout period it'll get the data from the cache rather than going to the server, but my gut instinct is that this is not what you are referring to.
    To access the data in the workflow message, you are correct, you would call getMessageValueCollection().  It will return an object hierarchy with objects defined in WorkflowMessage.js.  Note that if your online request fails, the data won't magically appear in your workflow message.
    To use the data in the workflow message to update a listview, feel free to examine the code in the listview widgets and in API.js.  You can also create a custom listview as follows:
    function customBeforeNavigateForward(screenKey, destScreenKey) {
         // In this example, we only want to replace the listview on the "My Approvals" screen    
         if (destScreenKey == 'My_Approvals'){
              // First, we get the MessageValueCollection that we are currently operating on
              var message = getCurrentMessageValueCollection();
              // Next, we'll get the list MessageValue from that MessageValueCollection
              var itemList = message.getData("LeaveApprovalItem3");
              // Because its a list, the Value of the MessageValue will be an array
              var items = itemList.getValue();
              // Figure out how many items are in the list
              var numOfItems = items.length;
              // Iterate through the results and build our list
              var i = 0;
              var htmlOutput = '<div><ul data-role="listview" data-theme="k" data-filter="true">';
              var firstChar = '';
              while ( i < numOfItems ){
                   // Get the current item. This will be a MessageValueCollection.
                   var currItem= items<i>;
                   // Get the properties of the current item.
                   var owner = currItem.getData("LeaveApprovalItem_owner_attribKey").getValue();
                   var type = currItem.getData("LeaveApprovalItem_itemType_attribKey").getValue();
                   var status = currItem.getData("LeaveApprovalItem_itemStatus_attribKey").getValue();
                   var startDate = currItem.getData("LeaveApprovalItem_startDate_attribKey").getValue();
                   var endDate = currItem.getData("LeaveApprovalItem_endDate_attribKey").getValue();
                   // Format the data in a specific presentation
                   var formatStartDate = Date.parse(startDate).toString('MMM/d/yyyy');
                   var formatEndDate = Date.parse(endDate).toString('MMM/d/yyyy');
                   // Decide which thumbnail image to use
                   var imageToUse = ''
                        if (status == 'Pending'){
                             imageToUse = 'pending.png';
                        else if (status == 'Rejected'){
                             imageToUse = 'rejected.png';
                        else {
                             imageToUse = 'approved.png';
                   // Add a new line to the listview for this item
                   htmlOutput += '<li><a id ="' + currItem.getKey() + '" class="listClick">';
                   htmlOutput += '<img src="./images/' + imageToUse + '" class="ui-li-thumb">';
                   htmlOutput += '<h3 class = "listTitle">' + type;
                   htmlOutput +=  ' ( ' + owner + ' ) ';
                   htmlOutput += '</h3>';
                   htmlOutput += '<p>' + formatStartDate + ' : ' + formatEndDate + '</p>';
                   htmlOutput += '</a></li>';
                   i++;
              htmlOutput += '</ul></div>';
              // Remove the old listview and add in the new one.  Note: this is suboptimal and should be fixed if you want to use it in production.
              $('#My_ApprovalsForm').children().eq(2).hide();
              $('#My_ApprovalsForm').children().eq(1).after(htmlOutput);
              // Add in a handler so that when a line is clicked on, it'll go to the right details screen
              $(".listClick").click(function(){
                   currListDivID = $(this).parent().parent();
                   $(this).parent().parent().addClass("ui-btn-active");
                   navigateForward("Request_Details",  this.id );
                   if (isBlackBerry()) {
                        return;
         // All done.
         return true;

  • How to decoding and encoding PNG and GIF images?

    I could decode and encode JPEG images using following create functions which are in com.sun.image.codec.jpeg package.
    JPEGImageDecoder decoder = JPEGCodec          .createJPEGDecoder(inputStream);
    JPEGImageEncoder encoder = JPEGCodec                    .createJPEGEncoder(outputStream);
    But I dont know required package and functions to decode and encode PNG and GIF images. Please help me.

    Is the API that hard to follow?
    ImageIO.read( file/stream/url)
    ImageIO.write( image, format (e.g. PNG, GIF(1), JPEG), file/stream what have you)
    1) Not sure if Java supports GIF saving, it might if you install JAI, or Java 6.

  • How to load and display the external flv video files in dynamicly and the how to control the flv fil

    How to load and display the external flv video files in dynamicly using AS 3.0
    and  How to control the flv file  add the play paus button and add seekbar.
    I have using to load the flv file following code
    var flvPlaceHolder1:MovieClip = new MovieClip();
    var vid1:Video = new Video(734, 408);
    flvPlaceHolder1.addChild(vid1);
    addChild(flvPlaceHolder1);
    flvPlaceHolder1.x = 1059;
    flvPlaceHolder1.y = 152;
    var nc1:NetConnection = new NetConnection();
    nc1.connect(null);
    var ns1:NetStream = new NetStream(nc1);
    vid1.attachNetStream(ns1);
    var listener1:Object = new Object();
    listener1.onMetaData = function(evt:Object):void {};
    ns1.client = listener1;
    ns1.play("GV-1600 TURNING.flv");
    ns1.addEventListener(NetStatusEvent.NET_STATUS, statusChanged1);
    function statusChanged1(ns1:NetStatusEvent):void
             trace(ns1.info.code);
            if (ns1.info.code == 'NetStream.Buffer.Empty')
                 trace('the video has ended');
                 removeChild(flvPlaceHolder1);
                 //trace('removeChild');
                gotoAndPlay(1786);
    then how to add the play,paus ,full screen button    and   seekbar,volumebar.

    I have to Create the flash presentation for our company product
    In this presentation the left  side the text animation are displayed then right side the our product video is displayed.
    In this presentation i need the following option :
    1, The first product video and animation is finished then the next product is played
    2, then the video displayed  (size width and height 400x300) , I click this video to increase the size(ex:1000x700)
    3, then the playing video i control  it play, stop, paus button and volume bar, seek bar.
    4, then this presentation is displayed on 42 inches LCD TV so this full presentation is run full screen.
    I have finished first two steps 1 and 2
    the following are the screen short and code:-
    code :-
    var count=0;
    var flvPlaceHolder2:MovieClip = new MovieClip();   
    var vid2:Video = new Video(734, 408);
    flvPlaceHolder2.addChild(vid2);
    addChild(flvPlaceHolder2);
    flvPlaceHolder2.x = 1059;
    flvPlaceHolder2.y = 152;
    var nc2:NetConnection = new NetConnection();
    nc2.connect(null);
    var ns2:NetStream = new NetStream(nc2);
    vid2.attachNetStream(ns2);
    var listener2:Object = new Object();
    listener2.onMetaData = function(evt:Object):void {};
    ns2.client = listener2;
    ns2.play("GS-4000.flv");
    this.addEventListener(Event.ENTER_FRAME, BtnFadeIn2);
    function BtnFadeIn2(event:Event):void
        if (this.currentFrame == 387)
            /*flvPlaceHolder2.x = 30;
            flvPlaceHolder2.y = 140;
            vid2.width=1800;
            vid2.height=800;
            trace('Screen size is changed');*/
            if(count==0)
            flvPlaceHolder2.x = 30;
            flvPlaceHolder2.y = 140;
            vid2.width=1800;
            vid2.height=800;
            count++;
    ns2.addEventListener(NetStatusEvent.NET_STATUS, statusChanged2);
    function statusChanged2(ns2:NetStatusEvent):void
        trace(ns2.info.code);
        if (ns2.info.code == 'NetStream.Buffer.Empty')
                trace('the video has ended');
                 removeChild(flvPlaceHolder2);
                 //trace('removeChild');
                gotoAndPlay(433);
    flvPlaceHolder2.buttonMode=true;
    flvPlaceHolder2.addEventListener(MouseEvent.CLICK,home2);
    function home2(e:MouseEvent):void
        if(vid2.width==734 && vid2.height==408)
            flvPlaceHolder2.x = 30;
            flvPlaceHolder2.y = 140;
            vid2.width=1800;
            vid2.height=800;
        else
            flvPlaceHolder2.x = 1059;
            flvPlaceHolder2.y = 152;
            vid2.width=734;
            vid2.height=408;

  • How to upload and share document from pages

    how to upload and share document from pages app?

    Hello dannafromfl,
    Documents can be shared via File Sharing to iTunes or via Email.
    Pages for iOS (iPad): Send and receive documents in email messages
    http://support.apple.com/kb/PH3564
    Pages for iOS (iPhone, iPod touch): Share documents by connecting to your computer
    http://support.apple.com/kb/PH3598
    Cheers,
    Allen

  • How to copy and paste text from one photo book page to another.

    hello,i downloaded this software 2days ago,and i've been having so much fun with it. pls i need help on how to copy and paste text from one photo book page to another. Secondly how to copy my completed photo book pages project to another laptop for printing. thanks
    This question was solved.
    View Solution.

    Hi DG.
    The easiest way to copy an HP Photo Creations project to another computer is to click the Share button. That will upload the project to the Web and give you a link you can paste into an email. Clicking the link on the other computer allows you to download the project and personalize it. This quick video shows the process. (The screen looks slightly different now, but the concept is the same.)
    Another way to share a project is copy the project folder to a thumb drive. Look in Documents/HP Photo Creations/My Things to find your saved projects.
    Our customer support team would be happy to walk you through the process. Contact them at [email protected]
    Hope this helps,
    RocketLife 
    RocketLife, developer of HP Photo Creations
    » Visit the HP Photo Creations Facebook page — news, tips, and inspiration
    » See the HP Photo Creations video tours — cool tips in under 2 minutes
    » Contact Customer Support — get answers from the experts

Maybe you are looking for