How to dynamically set the height and width of the image?

I'm trying to dynamically set the size of an image of "spacer", but this doesn't seem to work.

"< img src ="Images/SpacerYellow.gif"width ="5"height =" < cfoutput query = "Img" > #Img.Jan # < / cfoutput > "/ >

When I insert the source of the page and the view, it is the HTML < img src = "images/SpacerYellow.gif" width = "5" height = "745014" / > why so the stil teeny tiny image? "

A better question would be, why are you trying to display an image of space which is more than 745 000 pixels high? The HTML code looks OK, so you may be panicking the browser.

From the point of view best practices, if you only want to display a value in the first row of a query, you can reference using the #MyQueryName.myColumn #. You need not include the query within the tag.

Tags: ColdFusion

Similar Questions

  • Get the height and width of an image

    I have therefore some images in my program that I'm loading. These images are much longer than the size of the screen. So I put in a ScrollView. My question is how can I get the height and width of an image. The image.width and image.height doesn't return the correct values.

    //add the image
    private function addImage():Container {
        var sp1:Container = new Container();
        sp1.sizeUnit = SizeUnit.PIXELS;
        sp1.debugColor = 0xFFFFFF;
        sp1.margins = Vector.([1,0,0,0]);
        sp1.align =ContainerAlign.NEAR;
        //sp1.setSize(650, 800);
    
        var myPattern:RegExp = / /g;
        var fileName:String = "./com/swiz/img1.png";
        var icon:Image = new Image();
        icon.setImage(File.applicationDirectory.resolvePath(fileName).url);
        //icon.setPosition(0,0);
        //icon.setSize(320,800);
        sp1.addChild(icon);
        sp1.setSize(650, icon.height);
    
        return sp1;
    }
    

    and my code scrollview is

    //add to the scrollView
    var scroller:ScrollPane = new ScrollPane();
    scroller.width = 650;
    scroller.height = 505;
    scroller.y = 0;
    scroller.addScrollContent(addImage());
    addChild(scroller);
    

    Thanks in advance!

    Hey shethab,

    in order to retrieve the height and width of your image, you must use use the an event listener on your image and check for the Event.COMPLETE event. What is happening because the image you upload is not built, it takes time to load into your application using the setImage() method. and when you check the width height after the setImage method, the image was not loaded and has no height and width to this second. If you use the event listener, you can retrieve the height and width as it was finally loaded.

    Try the following code:

    import flash.events.Event;
    
    //add the image
    private function addImage():Container {
        var sp1:Container = new Container();
        sp1.sizeUnit = SizeUnit.PIXELS;
        sp1.debugColor = 0xFFFFFF;
        sp1.margins = Vector.([1,0,0,0]);
        sp1.align =ContainerAlign.NEAR;
        //sp1.setSize(650, 800);
    
        var myPattern:RegExp = / /g;
        var fileName:String = "./com/swiz/img1.png";
        var icon:Image = new Image();
        icon.setImage(File.applicationDirectory.resolvePath(fileName).url);
        icon.addEventListener(Event.COMPLETE, onImageLoaded);
        //icon.setPosition(0,0);
        //icon.setSize(320,800);
        sp1.addChild(icon);
        sp1.setSize(650, icon.height);
    
        return sp1;
    }
    
    private function onImageLoaded(e:Event):void
    {
        trace("image height: " + e.target.height + " image width: " + e.target.width);
    }
    

    hope that somethings brightened. Good luck!

  • How to display the height and width of an image that I adjust them

    How display the height and width in pixels of an image that I adjust them until I actually have to crop the image?

    You can make the Panel visible Info and see dimensions in various operations.

    It is often useful to define the rules to read in Pixels (in the section units and rules of preferences).

    -Christmas

  • How to dynamically set the width of the bitmap as mobile size and adjust accordingly the photo.

    I have the bitmap image. Now, I want the bitmap to the screen but its size should be as mobile width and adjust the picture accordingly. For the former I enlarge it should look like small small mobile screen.

    My code but its not working.

    public static BitmapField getHeader() throws NullPointerException {}
    Bitmap b = Bitmap.getBitmapResource("img/logo.jpg");
    return (new BitmapField (b, Field.FIELD_HCENTER) {})
    Protected Sub layout (int width, int height) {}
    setExtent (365, 80);
    }
    });
    }

    You will need to put the image yourself to match the dimensions you need.

    Watch Bitmap.scaleInto)

    If you have transparent images, then watch this:

    http://supportforums.BlackBerry.com/T5/Java-development/resizing-transparent-bitmaps/Ta-p/703239

  • How to dynamically set the filter IR APEX of the value of a radio button column?

    Hello

    I built a simple APEX 4.2 IR report that includes column, namely "Source_Data" and a separate user to input radio button namly "P33_SOURCE_DATA" with two possible values in 'X' or 'Y '.

    I would like the report filter source_data = 'X' or source_data = "Y" is applied, after each time the user clicks on the radio button P33_SOURCE_DATA. "

    So my question is, how to set the value of the IR filter using the value of P33_SOURCE_DATA to the dynamic action and javascript?

    Thanks in advance.

    Concerning

    Susanna

    In this case, you can pull an onchange dynamic action on the radio, or at the click of a button.

    This dynamic action update your IR region

    And your IR region would have an appropriate where clause, with "Page to go" set on your radio.

  • How to dynamically change the image depend on the input parameter

    Hi all

    I have a running report depend on the particular organization, I have 15 operating unit and 15 different logo for each operating unit.

    How to change the Logo depend dynamically on the entrance past the user.

    If I have three or four logo I can add to my disposal help if another statement and his works fine but I have more than 10 logos so it was not possible to keep these in my RTF model.

    Is it possible to change the logo according to the entry without keeping this model.

    I saw this link but its not very well

    http://erpschools.com/articles/display-and-change-images-dynamically-in-XML-Publisher

    Concerning
    Srikkanth.M

    Can u send me the files?

  • How to dynamically set the containers/component

    Hello

    I want to put on if containers of other condition.i.e condition if - set another container2 container1. How can I do? Any reference?

    Hey there,

    Because the way this all happens at the start of your application, simply use the add method that Simon bound for you in his first response.  Don't worry the method replace because that is only for all the containers that are already visible (or is already a child) within your root container (or whichever it is).

        // Just as an example from QSettings...
        if (mySettings.value("firstcontainer", 0) == 1) {
            myFirstContainer = Container::create()
                .layout(StackLayout::create())            .objectName("firstContainer")
                .vertical(VerticalAlignment::Center);
            // Add anything else for your first Container...
            // Then finally, you add it to your main or root
            // container with the add() function. Hopefully your
            // mainContainer is either a class member variable or
            // declared and initialized somewhere above this        // if-else statement.
            mainContainer->add(myFirstContainer);
        } else {
            mySecondContainer = Container::create()
                .layout(StackLayout::create())            .objectName("secondContainer")
                .vertical(VerticalAlignment::Center);
            // Add anything else for your second Container...
            mainContainer->add(mySecondContainer);
        }
    

    However, if somehow somewhere else in your application, you want to change the containers because the user has changed the value QSettings, you would replace it...

    if (user_wants_firstContainer) {    replaceC = mainContainer->findChild("secondContainer");    myCurrentContainer = myFirstContainer;} else {    replaceC = mainContainer->findChild("firstContainer");    myCurrentContainer = mySecondContainer;}
    
    if (replaceC) {
        replaceIndex = mainContainer->indexOf((Control*) replaceC);
    
        if (replaceIndex >= 0) {
            replaceC = (Container*) mainContainer->replace(replaceIndex, myCurrentContainer);
            // If you want to, you can just delete the replaced container here
            delete replaceC;
        }}
    
  • How can I control the monitor photo height and width with XP?

    Having 24 ' ASUS monitor.  There are no controls for the height and width of the image.  Operating system is Windows XP.  How can I change picture height and width?

    Hello

    You can try to change the resolution of the monitor screen and check if that helps.

    To change your screen resolution

    http://www.Microsoft.com/resources/documentation/Windows/XP/all/proddocs/en-us/display_change_screen_resolution.mspx?mfr=true

    If you want to change the position and other options that are provided as an option on the screen of the monitor you can see the manual provided by the manufacturer or contact the manufacturer for more information about the options provided in the monitor to change the position of the screen.

  • How to outsource the JNDI name (dynamically set the JNDI name)

    Hello

    In the adapters such as ftp, database, must specify the jndi name. This binds the adapter to a particular jndi name. It's certainly better that connect the adapter directly to the physical resource, I was wondering if it is possible to have still more flexibililty-setting the jndi name dynamically.

    Basically my requirement is to develop a web service that reads a file from a FTP location. I know that I can outsource the file name and directory, but I wonder how to dynamically set the ftp location.

    http://Darwin-it.blogspot.com/2008/03/configuration-of-FTP-synchronous-get.html gives the answer if I want to set the host name, portname, user id and password.

    But I want to configure the adapter got FTP and then use this JNDI name in my service. Is this possible... I am using SOA 10.1.3.3

    Kind regards
    Amit

    I've sent.

    -Rigault.

  • How to set the size (height and width) 100% swf

    Hi all

    Here, I want to put my SWF height and width to 100%.

    If I want to increase my height by hanging out on my corner SWF then automatically the width should change.

    If the two should be 100% in all cases. How to get there.

    In the browser? Flash can not set the size of itself - its size is defined in the HTML code. You must use JavaScript to set the Flash object width and height on window resize event.

  • How to set the height and width of dvt:piechart?

    Hello

    After upgrading to 10.1.3 jdev the new PIE is < dvt:pieChart >.

    I need to set the width and height or if not possible set the height and width of the container and let the repeating table using the container.

    Thanks in advance

    Emile BITAR

    Change this by using the attribute "inlineStyle". Set inlineStyle = "width: 200px;" height: 300px; »

  • How to change the runtime of height and width of the front panel

    How to change the front height and width during execution. Basically, I want to decide height or width according to some parameters that I'm in the moment of execution.

    Ed johnsold was first

  • How keep the anchor in the Middle during the change of height and width for extendscript model?

    When I try to change my composition height and width using extendScript, it works but with anchor point at the upper left corner. How to maintain it in the Center?

    My code:

    COMP. Width = 4000;

    COMP. Height = 4000;

    result:

    result.jpg

    expected:

    expected.jpg

    Thank you

    OK, here is therefore the function for resizing of the model code. I tested several times with anchor points are offset on layers and centered, even with layers that are not yet within the limits of the Model Viewer. I'm sure there will be some users who eventually find something that will break it, but for now it seems to work perfectly.

    app.beginUndoGroup("CompResize");
      var myComp = app.project.activeItem;
      resizeComp(myComp, 500, 500);
    app.endUndoGroup();
    /* TESTING ABOVE */
    
    function resizeComp(compObj, newWidth, newHeight){
      if(typeof newWidth == "number" && typeof newHeight == "number"){
      if(compObj instanceof CompItem){
      var locData, allLayers, allLayersLen, curLayer, clAP, clPos, xShift, yShift, oldCW, oldCH, clH, clW, xOff, yOff;
      pData = new Array();
      cWidth = newWidth;
      cHeight = newHeight;
      allLayers = compObj.layers;
      allLayersLen = allLayers.length;
      oldCW = compObj.width;
      oldCH = compObj.height;
      compObj.width = cWidth;
      compObj.height = cHeight;
      for(var i=1; i<=allLayersLen; i++){
      curLayer = allLayers[i];
      clW = curLayer.width;
      clH = curLayer.height;
      clPos = curLayer.transform.position.value;
      clAP = curLayer.transform.anchorPoint.value;
      xShift = (oldCW - cWidth)/2;
      yShift = (oldCH - cHeight)/2;
      curLayer.transform.position.setValue([clPos[0] - xShift, clPos[1] - yShift]);
      }
      }else{
      alert("Invalid argument(1):\nComp Object required.");
      }
      }else{
      alert("Invalid argument(2/3):\nInteger required for Width and Height.");
      }
    }
    
  • Set the height and width of pop-up window.

    Hi friends,

    I have a button Add a new element on the page no 1.i have 3 not on page no 2 as ITEM_CODE, nom_element AND STATUS.
    I want when I click on add new item on the page no 1, and then open the page not 2 like a window popup with the height and width 500 700 and after press submit value insert into the table and pop-up window must be close.
    I take model Popup

    How can I adjust height n weidth of page 2 of the popup.


    Thank you

    Hello

    You must be a mistake. Process of Close popup works very well in Apex 3.2.

    Remove all branches of page 20 and check that you have not any condition the process Close popup

    Kind regards
    Jari

  • show the height and width of the screen

    Is it possible to display the height and width of the screen in a labelfield?

    Yes. To do this, ask yourself two questions:

    (1) is it possible to display a string that I want in a LabelField? (The answer is Yes)

    (2) is it possible to set the height and width of the screen in a string? (The answer is Yes)

    (3) is it possible to find the height and width of the screen? (The answer is Yes)

    Now, just try to find how to do it ask these three questions. #1 is right there in the documentation for class, LabelField . #2 is trivial if all goes well. # 3, take a look in the view class.

Maybe you are looking for