Display BLOB picture in Datawindow (JPG)

Posted on 2011-10-24
Last Modified: 2013-12-26

I am trying to display jpg's in a datawindow. Those pics were stored in a table using UPDATEBLOB.

Now my problem is that I was only able to display BMP's in the datawindow (using an OLE object, Class = Paint.Picture). I am aware that this class only handles bitmaps.

Does anybody know what Class to use in order to display jpg's?

Your answer is very much appreciated.


P.S. I am using powerbuilder 11.5
Question by:theet
    LVL 4

    Expert Comment

    try to create a picture object and put the image inside this, like example:

                      // Mostra a foto na tela do colaborador
                      SELECTBLOB imagem INTO  :lb_imagem
                              FROM colaborador
                              WHERE nr_matricula = :ll_matricula ;
                      if len(lb_imagem) = 0 or isnull(lb_imagem) then
                            p_1.PictureName = " "
                            p_1.visible = false
                            p_1.visible = true
                      end if


    Author Comment

    Thank you for your answer - but I can't use a picture object because I need the pic in a datawindow (one per row)...
    LVL 1

    Expert Comment

    1 - Create a datawindow with a picture inside and point the picture address to a temporary folder  defining a standard name, for example idnumber+”.jpg”
    2 - Delete all files in temporary folder
    3 - Extract all images to that folder using standard name defined
    4 - Retrieve datawindow.

    Author Comment

    Thank you for this suggestion... But unfortunately that isn't possible in my case. Isn't there a way to display those pictures in a datawindow???
    LVL 29

    Expert Comment

    I've requested that this question be closed as follows:

    Accepted answer: 500 points for carcarah's comment http:/Q_27412412.html#37099363

    for the following reason:

    This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

    Author Comment

    Is there really no other possible solution???? What about OLE, Active-X or something like that... I really need a solution.
    LVL 1

    Expert Comment

    The problem is: you don't have a way to "device" to send the picture from database directly to page. You need a place to extract image before show it in the page.
     I frankly have doubts if maintain images in data base is a good idea. The only good reason to do this would be security issues. If you separate the pictures in a shared folder and insert in the database just picture's address you would have a better performance.


    Author Comment

    That's the way we have been doing it. But in large networks it is sometimes hard to get people to save their immages in a public folder so everybody has access... And some of the pictures need to be protected because we're in the health industry. So I really wish there was a solution to this problem....

    Accepted Solution


    I think I found a work around: I am using a inkPicture control within the datawindow. That type of controll is designed for collecting pen input on a tablet pc but it seems to work fine for just displaying blob pics.

    Is there a reason for not using this control?


    LVL 2

    Expert Comment

    by:Ariel Garcia
    Yes this can be done, i create a recognition software and need this behavior, i create a small DW with one parameter the id of image to show, then the main DW include this DW-Image with proper paramter then all was ok.

    If you like more then give me advice, but the concept are OK.

    Well i dont use show as picture inded i use a picture-ink object to show the picture, in the small Dw.

    --- Unless this methode was to Screen, if you try to create a catalog of images the best way are save images to disk then include in the Dw "as string variable" then show as picture.

    I hope this usefull to you

    Expert Comment

    Hi Theet,

    I do have same problem. I have tried to use inkPicture but it is not working well in my case. Can you help me in this situation. I'm using PowerBuilder 10.5. MySQL 5.5 and MySQL ODBC/Connector 5.1.

    Images are save into database MySQL database mediumblob column. from VS 2010, class library. Image format is JPEG.

    Well, I'm able to see those images in Picture Control in Window object using SelectBlob. But my issues is to show those images in Datawindow for each row.

    Your help will be highly appreciated.

    Thanks in advance,

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    This article describes some very basic things about SQL Server filegroups.
    SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
    The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now