Topic
  • 5 replies
  • Latest Post - ‏2014-08-08T17:56:58Z by KatherineWilson
SystemAdmin
SystemAdmin
3180 Posts

Pinned topic How to use layout DXL to display Pictures

‏2010-11-10T12:45:07Z |

Using the wizard to create traceability columns works fine when you want to display attributes and OLEs - but Pictures?

I am stumped when it comes to displaying pictures... With some help I've been experimenting on just displaying pictures in a column in the same module:

if (getPictName (obj) != "") then {
    //display "Picture"
    int h = 0, w = 0
    getPictWidthHeight(obj,w,h)
    DBE cnv = getCanvas
    setHeight(h)
    setWidth(w)
    string sFileName = getPictName(obj)
    bitmap(cnv, sFileName,0, 0)
} else {
    display ""
}


which does show some pictures. Bitmaps and moving GIFs returns height and width as 0,0. The pictures are not resizeable as in the main column. And how do I dynamically make space for text and other pictures, if I am following links instead of just handling the current object.

And input would be greatly appreciated!

/Kristian

Updated on 2013-12-19T20:52:23Z at 2013-12-19T20:52:23Z by JAntley
  • llandale
    llandale
    3005 Posts

    Re: How to use layout DXL to display Pictures

    ‏2010-11-10T15:38:18Z  
    Don't know.

    If this were me, I'd try to get the Picture format and have special code for the ones that don't work; using this perm and these constants:
    int getPictFormat(Object)
    int formatBMZ
    int formatWMZ
    int formatEMF
    int formatEMZ
    int formatRLE
    int formatTIF
    int formatTIFF
    int formatGIF
    int formatJPE
    int formatJFIF
    int formatJPG
    int formatJPEG
    int formatUNKNOWN
    int formatEPSF
    int formatWMF
    int formatDIB
    int formatBMP
    int formatPNG_
    int formatPNG

    If you cannot play around and make it work, at least you could isolate the formats that don't display, and display "XYZ Format picture un-displayed".

    And if I were to play around with it, I'd then go to my Windows File Types from Windows Explorer and make sure those format types are associated with some program like Paintbrush.

    And if I really wanted to solve it, I'd say something else pretty silly because I know it would encourage other folks who may know to chime in and correct me. Lets hope that happens here.... lol

    Well actually, if it was me I'd cut the picture, use MS-Word and create a Word object, paste the picture, then copy the word object and paste it back into the Module as an OLE. Get rid of all the Pictures, they byte.

    • Louie
  • Drethon
    Drethon
    2 Posts

    Re: How to use layout DXL to display Pictures

    ‏2010-12-29T15:28:41Z  

    Here is my code for rendering a picture in a canvas as well as moving it for scrolling.
     

    // Renders and positions a OLE object in the canvas.
    void DoDraw_CB ( DBE DBEElement )
    {
        Bitmap b ;
            Object oleObject ;
            
                    // If an objects in the list was selected or an OLE is already displayed.
            int listIndex = get ( OleList ) ;
            if ( ( listIndex >= 0 ) ||
                  ( OleObject != null ) )
            {
                            // Clear the background and get the object with the OLE.
                    background ( OleCanvas , colorWhite ) ;
                    if ( listIndex >= 0 )
                    {
                            oleObject = get ( OLEObjects , listIndex , 0 ) ;
                    }
                    else
                    {
                            oleObject = OleObject ;
                    }
     
                            // Turn the OLE into a bitmap and draw it on the screen, positioned for scrolling.
                            // Positioning is inverse of scrolling as to move the view right, the image has to move left.
                    b = oleLoadBitmap ( OleCanvas , oleObject , false , ImageX , ImageY ) ;
                    drawBitmap(OleCanvas,b,-ScrollX,-ScrollY) ;
                    
                            // Select the object the OLE came from.
                    current = requirementModule ;
                    current = oleObject ;
                    int objectNum = oleObject."Absolute Number" ;
                    gotoObject ( objectNum , requirementModule ) ;
            }
    }
    
    Updated on 2013-12-19T20:52:58Z at 2013-12-19T20:52:58Z by JAntley
  • KatherineWilson
    KatherineWilson
    2 Posts

    Re: How to use layout DXL to display Pictures

    ‏2014-08-07T21:22:02Z  

    Did you find a way to include a picture in a layout DXL?  Looking to do something similar.  

  • llandale
    llandale
    3005 Posts

    Re: How to use layout DXL to display Pictures

    ‏2014-08-08T17:08:11Z  

    Did you find a way to include a picture in a layout DXL?  Looking to do something similar.  

    Don't know.  But I'm confident that since Layout DXL refreshes maybe 10 times a second, response time will be terrible.  Use an Attr-DXL and display it.

  • KatherineWilson
    KatherineWilson
    2 Posts

    Re: How to use layout DXL to display Pictures

    ‏2014-08-08T17:56:58Z  
    • llandale
    • ‏2014-08-08T17:08:11Z

    Don't know.  But I'm confident that since Layout DXL refreshes maybe 10 times a second, response time will be terrible.  Use an Attr-DXL and display it.

    Thanks for the suggestion!  I'll give it a try.  Do you happen to know of any examples of Attr-DXLs being used to display a picture?