Contact information for return pixel Imaq image with the mouse click event

Hello

I'm trying to get the coordinates in pixels of an image Imaq based on a mouse click event, similar to this post and this post. The problem is that with the first post, I get the coordinates in the image control and hesitate to trust them, they seem to have the Center origin, may return negative coordinates and do not represent the actual size of the detector that I use (512 x 512). It also returns the coordinates outside the actual data when it is clicked on the image control framework. The second method returns simply null coordinates. What I want are the coordinates of the pixel displayed when hovering the mouse imaq image control framework.

What baffles me, is that I tried the second method with a png stock file and it works fine, it is only when I create an image from the data of my camera than the coordinates are returned null. Note data views of camera under control of image very well.

Any ideas would be useful. Enclosed is a picture of the offending code and the Panel before displaying the camera data is coming (I know it needs some cleaning).

Thank you

Tyler

for help, please send your vi

but I think that this example vi is your solution

check this vi

Tags: NI Software

Similar Questions

  • Drawing line with the mouse clicks on picture indicator

    Hello

    I need to import a JPG file in an image control, draw a line in 2 clicks, read bothe XY positions and perform some basic trigonometry. Any simple or striaghtforward way to draw the line with the mouse and read thos passay on the bitmap (positions relative pixel)?

    Thanks in advance,


  • Problem with 'if - ElseIf' statement with the mouse, click.

    I'm having a problem with the code IF ELSE use with a mouse click. I want whenever a user 'clicks' I want to run a particular block of code, up to 3 clicks, then nothing. I tried var meter click local and global but can't seem to cross the first '' if. '' That's what I have now (I use console.log () to keep track.

    Ready model I create a global var...

    Enter the code to run when the composition is fully charged here
    sym.getComposition () .getStage () .setVariable ('clickcnt', 1); //Set 1 meter

    var i = sym.getComposition () .getStage () .getVariable ('clickcnt');

    Console.log ("count starts at"+ i ");


    on the stage, I create an event 'click '...

    Insert the code for the mouse, click here
    var i = (sym.getComposition () .getStage () .getVariable ('clickcnt');)
    If (i = 1) {}
    Console.log ("counter is =" + i);
    c code
    sym.getComposition () .getStage () .setVariable ('clickcnt', 2); //Set against 2
    }
    ElseIf (i = 2) {}
    Console.log ("counter is =" + i);
    c code
    sym.getComposition () .getStage () .setVariable ('clickcnt', 3);
    //Set against 3
    }
    ElseIf (i = 3) {}
    Console.log ("counter is =" + i);
    c code
    sym.getComposition () .getStage () .setVariable ('clickcnt', 4);
    //Set against 4 to take away
    SYM. Play (100); //play scenario animation
    }
    else { //I'm using it to deny any additional clicks.} I don't know there is a good way to do this. I don't know him
    SYM. Stop (1000);
    Console.log ("End");
    }
    ;

    I when I run this it never happened the first if it's like the 'clickcnt' var is not getting updated or read correctly.

    Thank you

    Joel H

    try if (I == 1) double equal.

  • Resizing an Image in the mouse Enter event

    Today is my first time trying this and I saw it at the spinning my wheels.

    I have Adobe Acrobat Pro DC

    I created a PDF form.  I put a button above (set the fill color to orange).

    Under properties I put

    Options

    layout = icon only

    Behavior - Push

    State = reversal

    has chosen the icon and closed.

    When I rollover button orange change button and indicates my icon image correctly.

    I want to take place, when I roll over the button I want the image to grow much larger.

    Can someone get me going in the right direction.

    Thank you

    -dan

    Add another button, make a grand as you want the image to appear, set its icon on the image you want to display, and set read-only. In the other button, set the mouse enter action on "show/hide a field" and configure it to display the image button. In the mouse exit event, do the same thing, but configure it to hide the button image.

  • CC 2015.4 LR. Cannot scroll through the images with the mouse wheel.

    I just upgraded to LR CC 2015.3 2015.4. Now I can't use my mouse wheel to navigate between images in the library loupe view. It worked fine in each version before.

    Thanks Jim. Opening and closing preferences again to work. Scrolling is fine now.

  • InDesign objects are not locked and will not move with the mouse click.

    I rebooted, uninstalled and reinstalled. Objects interact with when the mouse is clicked. The contours of the block came and the object can be selected and changed, however it will not move with a mouse. Objects respond to the arrows when the issue is raised; but it's heavy at best.

    I gave in my computer image. What was the origin of the problem, is now gone. Thanks for your help.

  • Please help me with the mouse over event on this clip

    I'm doing a view in flash box that slides out toward the right and opens on the mouse.

    I did the necessary actionscripting, according to me, and yet the clip quite does not properly

    Can someone help me please

    I included a link to download the .fla file because it won't let me attach here with this post by saying "the content of this attachment type is not allowed."

    http://rapidshare.com/files/258224416/slider.Fla.html

    Thanks in advance,

    ELBEE.

    {run}
    _parent. Play();
    }

  • Default with the mouse, click on?

    Hi guys,.

    I'm fairly new to LabVIEW, and indeed this forum, so I hope you can help. I guess this is a simple problem, but I can't understand how do.

    I have a cRIO taking 4 analog voltages. Each voltage comes from a linear potentiometer which is the displacment of suspension on a formula student race car.

    I have a simple formula set up to convert the voltage to displacment. I created a table of entries that allows me to the maximum, minimum, value (from the previous probe calibration) and "stationary" value of each sensor.

    The "stationary" value, is what the sensor should be read when the car is stopped. This is then used as the basis for positive or negative displacments.

    My problem is that whenever a different driver gets in the car, the susspension is adjusted or fuel is added, the "stationary" value will be different. I then have to manually define the stationary value to whatever the current value is when the car is stopped, press "default current worth" and save the VI before continuing.

    What I would like to, is a "calibrate" button that I can support on that sets the "stationary" regardless of the current input voltage is. In this way, I wouldn't reset the 4 values each time the car has been modified.

    If you have any ideas on how to do this, please let me know.

    I will attach my VI as soon as I return to the laptop where it is saved!

    Thank you

    Kevin Irving

    Kevin,

    As you have discovered, you cannot change the default values on a VI running.

    The best way to do what you want is to use a configuration file.  There are a set of screws specifically designed for this purpose in the palette file IO.  When the user presses the button "calibrate", the values are stored in the file. When the program starts, it reads the file and sets controls on the values in the file.  You can even keep different for each driver sets, if the data are fairly consistent.

    Read the help detailed for the screw configuration files and look at the examples.  It will show you how to get started.

    Lynn

  • Newbie with the mouse event question

    Hello! I started playing with as3, and I have a function for mouse clicks that draws a shape on each click. However, the mouse click event does not appear to work except when I click on a MovieClip, that I placed in the middle of the screen. Is there a way to make the mouse click event recognize when I click anywhere on the screen?

    Thank you

    Will be

    public void newGame()

    {

    Avatar = new Avatar();                                                  Click the mouse entered only when you click on the avatar?

    addChild (avatar);

    avatar.x = mouseX;

    avatar.y = mouseY;

    addEventListener (MouseEvent.CLICK, clickHandler);

    gameTimer = new Timer (25);

    gameTimer.start ();

    }

    you need to add the event listener to the stage

    stage.addEventListener (MouseEvent.CLICK, clickHandler);

    However you must make sure that this step is not null

    If the code above throws an exception to reference null, you'll also need to add and ADDED_TO_STAGE listener

    post the rest of your code and I can help you with that

  • With the help of the mouse click to return the coordinates of the image.

    Okay, so I tried to find a way to do it, and it seems very complicated for something that sounds really simple.

    Anyway. I have a camera that updates an object image on the front panel using a while loop. I have another image object that is updated with a still image when you press the button "snap." Now what I want to do is to click on a point in the image that are broken and have the VI to return the coordinates of this pixel as part of coordinated image.

    What I have so far is a structure of event in the while loop with the following to happen where "image object-> the mouse down:

    Server reference (reference to the image object)-> property (last position of the mouse)-> output coordinated screen node.

    I have two errors that don't make much sense to me (I have not worked with before event structures): ' event data node contains terminal unwired or bad "and"structure of the event one or several cases of event have no defined event. " This second shot seems odd because I don't actually want nothing to take if there is no click of a mouse. The first seems to refer to the box of the element on the left side of the structure of the event.

    Above is my last attmpt to the trouble of sorting and as far as I can see it should work. whatever about the errors, I even take the right approach with that? I would have thought cordinates image would be quite common but seek advice here, it does not seem...

    A bit puzzled here. Any help is very appreciated.

    Hello RoBoTzRaWsUm,

    I took a glance at your VI, who took a correct approach to the data you are looking for.  As you structure to aid and the event, you should look for an event to occur.  When you use a property node, you try to read an attribute of a control.  However, in a Structure of the event, I think you should use a node to invoke.  Allows a node to invoke your read an event or write a method with the control class in LabVIEW.

    1. place down and call the node in the Palette of functions in "Programming"-> "Application Control".

    2 wire your reference Image control to this

    3. click on the method, and then select 'get a last event. "

    4. right click on "Events that" and "create Constant.  Do the constant '1' in the table

    5. read the Cluster "Contact information" from the left side of the case of the event by clicking and "create indicator.

    You will find a piece of code attached example.

    Concerning

  • HP 15-r249tu: for the last two months I inform HP to address my problem with the laptop HP 15-r249tu.

    For two months I contact HP chat support to fix my problem with my HP laptop 15-r249tu with the L2Z88PA product id. The laptop was completely dead and does not work. I contacted HP for cleaning on site (it covers the warranty on site) and there is still no reply fron their side. So I intend to give a complaint to the Court of the consumer against the owner of the store that I bought the laptop (he only said support HP was good and me to buy the misleading HP product)

    It took the shop and he told to contact HP support for replacement of the battery. So I contacted HP support for this problem and they said to do a battery test. So I did test battery and shows like 'calibrate '.

  • My photos will open VLC with the left click. Need to open context menu for images

    When I double left-click on the icon my images the VLC page is displayed in the upper left corner of the screen and nothing happens when I click on the arrow of VLC playback. The same thing happens with picture files.  I've never had this problem before and cannot find a "Restore Defaults" to return to normal. Help, please!

    HI Milton,

    Explore the My picture folder in your My Documents or navigate to the location of the image. Click right-> one of the image-> Openwith files select "choose program"-> select "Windows fax and picture viewer"-> Tickmark "always use the selected program..." -> Ok.

    You will be able to open the rest of the images using the left-click in the picture windows and fax viewer, if you use another program, you can select the program accordingly.

    I hope this helps.

  • Creating a homepage for Apex using horizontal Images with label list?

    Hello

    I am trying to create a homepage for my application, which contains some intro text and images that would like specific interactive apex reports.

    However, I created a list using the horizontal Images with the list of the label template and during execution of the page - no images are displayed - it just displays the missing image icon

    The question I have, this is where are these defined images and how do I add a custom image for each item in the list

    You can do it in the apex by simply using a predefined list templates or even customize existing list templates.

    I suggest you to go through the sample application and try to understand how the entries in the list are defined and where to use the IMAGES.

    In the APEX of the layout defined in the templates page and the positioning of regions (lists in your case) are based on their Display Position

    Pass by this
    http://docs.Oracle.com/CD/E23903_01/doc/doc.41/e21674/nav_list.htm#CACCJHEE

  • Contact information for the user

    Hi, I want to access the application to the personal data of the users. Name, phone, email, etc... How can I get this information?

    As far as I know, you will not be able to access "contact information" unless you embed a form in the application are users to fill in the details themselves (sharing of personal data and the extraction is illegal in some countries). You can create an HTML form and use in your folios where end-users can fill the data itself and create a 'Submit button' who sent you the details.

  • Need a Script to the space of images on a total gap, then tag each image with the percentage of the total image space

    By editing the other scripts, I found here and other sites (including the labels size rorohiko), I worked on a script that will each image with the dimensions of the label and calculate the percentage of the spread of everything (including the text, white space).

    Now, I was invited to a script that tagged the images with the percentage of total image on a gap space. This script is so space images on a total gap, then tag each image with the percentage of the total image space. For example if there is an image that is 10 x 10 inches and four pictures that are images of 2.5x2.5, 10 x 10 would be tagged with 50% and the 2.5x2.5 would be tagged with 12.5%.

    This is the script that does the percentage of total circulation. Can some clever person get to do what I need?

    Suze

    (Sorry, I don't know how to post the script here with line numbers!)

    //

    This script adds printing of information labels to each graphic image. The labels are on a separate layer

    named "PercentageLabels" so that all these added labels can be removed again by simply removing

    the layer.

    //

    If you move or resize items, simply re-run the script to update the labels.

    //

    Before (re) start the script, you can define a paragraph style "SizeLabelStyle".

    This style will apply to all content on labels.

    //

    Before (re) start the script, you can set a style of object 'SizeLabelObjectStyle '.

    This style of object apply to all executives of the label - so if you want a specific background

    fill out or frame, do it through this object style.

    //

    You can change the units of the size label. I put in inches. Change the line below that has

    kUnitToUse - you can use:

    MeasurementUnits.CENTIMETERS

    MeasurementUnits.CICERO

    MeasurementUnits.INCHES

    MeasurementUnits.MILLIMETERS

    MeasurementUnits.PICAS

    MeasurementUnits.PIXELS

    MeasurementUnits.POINTS

    //

    By default the script will not attempt to label the "nested" images If you also want to label

    nested images (for example inline images, anchored frames, pasted images in the images,...) to change the line

    below to read:

    kLabelNestedItems = 1

    //

    If you want a specific image to stay without a label, you can use the Script label palette for

    assign a script called 'ignore' for this frame. The script will then not label this framework to the

    the title of the script is removed again.

    //

    Change the lines with kDontLabelImageFrames, kDontLabelTextFrames, kDontLabelOtherFrames

    below if you want to restrict labelling to only certain types of images: replace the '0'

    in "1" to enable these options.

    //

    Change the line with kShowImageFileName if you also want to display the names of the image in the

    size for the picture frames.

    //

    Small frames are not labelled - the cutoff point is currently a less than 0.1 inch high framework

    or 0.1 inch wide. You can change the cutoff point by adjusting the lines with kDontLabelBelowWidth

    or kDontLabelBelowHeight below.

    //

    var Girard;

    var gScriptFile;

    var gCaches;

    // ****************

    That's cheating spread automatically calculated

    var doc = app.activeDocument;

    doc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.inches;

    doc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.inches;

    PageWidth = doc.documentPreferences.pageWidth var;

    stucture var pagewidth = * 2;

    var spreadheight = doc.documentPreferences.pageHeight;

    var spreadsquinch = stucture * spreadheight;

    Alert ("the total measure of square inch of spread is:" + spreadsquinch);

    //******************

    VR;

    {

    If (app.activeScript instanceof file)

    {

    var gScriptFile = app.activeScript;

    }

    }

    catch (Girard)

    {

    }

    If (typeof (kLogLevel) is "undefined")

    {

    const kLogLevel = 5;

    const kMaxLogNestLevel = 5;

    const kLogToMessageBox = 0;

    const kLogToConsole = 0;

    const kLogToFile = 0;

    const kLogFileName = "PercentageLabels.log";

    const kIgnoreFrameLabel = "ignore."

    const kSizeLabelLayerName = "PercentageLabels";

    const kLabelNestedItems = 0;

    const kDontLabelImageFrames = 0;

    const kDontLabelTextFrames = 1;

    const kDontLabelOtherFrames = 0;

    const kUnitToUse = MeasurementUnits.INCHES;

    const kShowImageFileName = 0; This set to 1 to precede the name of the image file in the tag

    Below all of the measures are expressed in kUnitToUse (e.g. inches if MeasurementUnits.INCHES is used)

    const kRoundToDecimals = 2;

    The separator to use between objects - for example MyImage.jpg - 7.22 x 9,34

    const kSeparatorBetweenNameAndSize = "-";

    const kSeparatorBetweenHeightAndWidth = "H x"; "

    const kSeparatorAfterWidth = "W";

    const kDontLabelBelowWidth = 0.1; In kUnitToUse

    const kDontLabelBelowHeight = 0.1; In kUnitToUse

    const kLabelStyleName = "SizeLabelStyle";

    const kLabelObjectStyleName = "SizeLabelObjectStyle";

    const kLabelHeight = 0.6; In kUnitToUse

    const kLabelWidth = 2.5; Expressed in kUnitToUse (e.g., inches).

    }

    var gRunState =

    {

    logToMessageBox: kLogToMessageBox,

    logToConsole: kLogToConsole,.

    logToFile: kLogToFile,.

    functionNestLevel: 0,

    logFunctionEntry: true,

    logFunctionExit: true,

    logLevel: kLogLevel,.

    logFileName: kLogFileName

    };

    Main();

    // ****************

    function ConvertToFrame (thePageItem)

    {

    / * / / / LogEntry ("ConvertToFrame");

    var retVal = thePageItem.getElements () [0];

    / * / / / LogExit ("ConvertToFrame");

    Return retVal;

    }

    // ****************

    function CollectionToArray (theCollection)

    {

    / * / / / LogEntry ("CollectionToArray");

    var retVal = theCollection.everyItem () .getElements () .slice (0);

    / * / / / LogExit ("CollectionToArray");

    Return retVal;

    }

    // ****************

    function GetImageFile (pageItem)

    {

    / * / / / LogEntry ("GetImageFile");

    var imageFile = null;

    do

    {

    Try

    {

    pageItem = ConvertToFrame (pageItem);

    If (!) (("allGraphics" in pageItem))

    {

    break;

    }

    var allGraphics = pageItem.allGraphics.slice (0);

    If (allGraphics.length == 0)

    {

    break;

    }

    var chart = allGraphics [0];

    var graphic.itemLink = link;

    imageFile = new File (link.filePath);

    }

    catch (Girard)

    {

    }

    }

    While (false);

    / * / / / LogExit ("GetImageFile");

    return imageFile.

    }

    // ****************

    function GetImageName (pageItem)

    {

    / * / / / LogEntry ("GetImageName");

    var imageName = "";

    do

    {

    var imageFile = GetImageFile (pageItem);

    If (imageFile is nothing)

    {

    break;

    }

    imageName = imageFile.displayName;

    }

    While (false);

    / * / / / LogExit ("GetImageName");

    return imageName;

    }

    // ****************

    function GetOuterPageItem (pageItem)

    {

    / * / / / LogEntry ("GetOuterPageItem");

    var retVal = null;

    do

    {

    Try

    {

    retVal = pageItem.parent;

    If (retVal instanceof spread | retVal instanceof Page)

    {

    retVal = pageItem;

    break;

    }

    If (retVal instanceof character)

    {

    retVal = GetOuterPageItem(retVal.parentTextFrames[0]);

    break;

    }

    }

    catch (Girard)

    {

    retVal = null;

    }

    }

    While (false);

    / * / / / LogExit ("GetOuterPageItem");

    Return retVal;

    }

    // ****************

    function LogMessage (message, collapseLines)

    {

    If (gRunState.logToConsole)

    {

    $.writeln (message);

    }

    If (gRunState.logToFile)

    {

    var logFile = new file (gScriptFile.parent + "/" + gRunState.logFileName);

    var now = new Date();

    logFile.open ("a");

    logFile.write (now.toString () + ":"+ message + "\n" ');

    logFile.close ();

    }

    If (gRunState.logToMessageBox)

    {

    Alert (message);

    }

    }

    // ****************

    LogEntry (message) function

    {

    If (gRunState.logFunctionEntry)

    {

    If (gRunState.functionNestLevel < kMaxLogNestLevel) {}

    for (var idx = 0; idx < gRunState.functionNestLevel; idx ++)

    {

    message = "" + message;

    }

    Filled (message + "<", true);

    }

    }

    gRunState.functionNestLevel ++;

    }

    // ****************

    function LogError (message)

    {

    If (gRunState.logLevel > = 1).

    {

    LogMessage ("* ERROR *:" + message, false);

    }

    }

    // ****************

    function LogExit (message)

    {

    -gRunState.functionNestLevel;

    If (gRunState.functionNestLevel < 0)

    {

    LogError ("LogExit: unbalanced nesting of function");

    }

    If (gRunState.logFunctionExit)

    {

    If (gRunState.functionNestLevel < kMaxLogNestLevel) {}

    for (var idx = 0; idx < gRunState.functionNestLevel; idx ++)

    {

    message = "" + message;

    }

    Filled (message + ">", true);

    }

    }

    }

    // ****************

    function LogNote (message)

    {

    If (gRunState.logLevel > = 3)

    {

    LogMessage ("Note:" + message, false);

    }

    }

    // ****************

    function LogWarning (message)

    {

    If (gRunState.logLevel > = 2)

    {

    LogMessage ("WARNING:" + message, false);

    }

    }

    // ****************

    function Main()

    {

    / * / / / LogEntry ("Main");

    var savedUserInteractionLevel = app.scriptPreferences.userInteractionLevel;

    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;

    do

    {

    Try

    {

    activeDocument var = app.activeDocument;

    If (!.) (activeDocument instanceof Document))

    {

    LogError ("hand: activeDocument isn't a Document");

    break;

    }

    var savedHorizontalMeasurementUnits = activeDocument.viewPreferences.horizontalMeasurementUnits;

    activeDocument.viewPreferences.horizontalMeasurementUnits = kUnitToUse;

    var savedVerticalMeasurementUnits = activeDocument.viewPreferences.verticalMeasurementUnits;

    activeDocument.viewPreferences.verticalMeasurementUnits = kUnitToUse;

    var savedRulerOrigin = activeDocument.viewPreferences.rulerOrigin;

    activeDocument.viewPreferences.rulerOrigin = RulerOrigin.PAGE_ORIGIN;

    do

    {

    Try

    {

    ProcessFrames (activeDocument);

    }

    catch (Girard)

    {

    Alert ("the script encountered a situation that we don't know how to handle. "He received the error, says '" + Parker + "' in Main()"); "."

    }

    }

    While (false);

    activeDocument.viewPreferences.rulerOrigin = savedRulerOrigin;

    activeDocument.viewPreferences.horizontalMeasurementUnits = savedHorizontalMeasurementUnits;

    activeDocument.viewPreferences.verticalMeasurementUnits = savedVerticalMeasurementUnits;

    }

    catch (Girard)

    {

    Alert ("the script encountered a situation that we don't know how to handle. "He received the error, says '" + Parker + "' in Main()"); "."

    LogError ("Hand throw" + Girard);

    }

    }

    While (false);

    app.scriptPreferences.userInteractionLevel = savedUserInteractionLevel;

    / * / / / LogExit ("Main");

    }

    // ****************

    function ProcessFrames (doc)

    {

    / * / / / LogEntry ("ProcessFrames");

    var err;

    do

    {

    If (!.) (doc instanceof Document))

    {

    LogError ("ProcessFrames: doc should be a Document");

    break;

    }

    Try

    {

    var existingLayer = doc.layers.itemByName (kSizeLabelLayerName);

    existingLayer.id;

    existingLayer.remove ();

    }

    catch (err)

    {

    }

    If (kLabelNestedItems)

    {

    var pageItems = doc.allPageItems.slice (0);

    }

    on the other

    {

    var pageItems = CollectionToArray (doc.pageItems);

    }

    var frameReferences = [];

    for (var pageItemIdx = 0; pageItemIdx < pageItems.length; pageItemIdx ++)

    {

    do

    {

    var pageItem = pageItems [pageItemIdx];

    If (pageItem.itemLayer.name is kSizeLabelLayerName)

    {

    break;

    }

    var pageItem = ConvertToFrame (pageItem);

    If (instanceof TextFrame pageItem)

    {

    If (kDontLabelTextFrames)

    {

    break;

    }

    }

    ElseIf (pageItem graphic instanceof)

    {

    If (kDontLabelImageFrames)

    {

    break;

    }

    }

    on the other

    {

    If (kDontLabelOtherFrames)

    {

    break;

    }

    }

    If (pageItem.label.toLowerCase () is kIgnoreFrameLabel)

    {

    break;

    }

    var width = pageItem.geometricBounds [3] - pageItem.geometricBounds [1];

    var height = pageItem.geometricBounds [2] - pageItem.geometricBounds [0];

    If (width < kDontLabelBelowWidth)

    {

    break;

    }

    If (height, kDontLabelBelowHeight)

    {

    break;

    }

    frameReferences.push (pageItem);

    }

    While (false);

    }

    var sizeLabelLayer = doc.layers.add ({name: kSizeLabelLayerName});

    for (var pageItemIdx = 0; pageItemIdx < frameReferences.length; pageItemIdx ++)

    {

    Try

    {

    var pageItem = frameReferences [pageItemIdx];

    var width = pageItem.geometricBounds [3] - pageItem.geometricBounds [1];

    var height = pageItem.geometricBounds [2] - pageItem.geometricBounds [0];

    var labelItem = doc.textFrames.add (null, LocationOptions.BEFORE, GetOuterPageItem (pageItem));

    labelItem.itemLayer = sizeLabelLayer;

    var boxsquinch = width * height

    var boxpercent = (boxsquinch / spreadsquinch) * 100

    var roundpercent = Math.round (boxpercent)

    var labelText = "";

    If (kShowImageFileName)

    {

    var imageName = GetImageName (pageItem);

    If (imageName! = "")

    {

    labelText += imageName + kSeparatorBetweenNameAndSize;

    }

    }

    labelText += RoundString (height, kRoundToDecimals) + kSeparatorBetweenHeightAndWidth + RoundString(width, kRoundToDecimals) + kSeparatorAfterWidth + ' \r\n'+ roundpercent + '% ';

    labelItem.contents = labelText;

    xPos = pageItem.geometricBounds var [1];

    yPos = pageItem.geometricBounds var [0] + kLabelHeight;

    labelItem.geometricBounds is [Posy, xPos, yPos + kLabelHeight, xPos + kLabelWidth];.

    Try

    {

    labelItem.parentStory.characters.everyItem () .appliedCharacterStyle = doc.characterStyles.item (0);

    }

    catch (err)

    {

    }

    Try

    {

    labelItem.parentStory.paragraphs.everyItem () .appliedParagraphStyle = kLabelStyleName;

    }

    catch (err)

    {

    }

    Try

    {

    labelItem.appliedObjectStyle = doc.objectStyles.itemByName (kLabelObjectStyleName);

    }

    catch (err)

    {

    }

    }

    catch (err)

    {

    }

    }

    }

    While (false);

    / * / / / LogExit ("ProcessFrames");

    }

    // ****************

    function RoundString (numVal, decimal)

    {

    / * / / / LogEntry ("Round");

    var retVal = Math.round (numVal * Math.pow(10,decimals)) + "";

    retVal = retVal.substring(0,retVal.length-decimals) + "." + retVal.substring(retVal.length-decimals);

    / * / / / LogExit ("Round");

    Return retVal;

    }

    What do you mean?

    var myDoc = app.activeDocument;
    var mySpreads = myDoc.spreads;
    var myRectangles = myDoc.rectangles;
    var myImages = 0;
    for (var i = 0; i < mySpreads.length; i++) {
        var mySpreadWidth = 0;
        var mySpreadHeight = myDoc.documentPreferences.pageHeight;
        for (var j = 0; j < mySpreads[i].pages.length; j++) {
            mySpreadWidth += myDoc.documentPreferences.pageWidth;
            }
        var mySpreadArea = mySpreadWidth * mySpreadHeight;
        var myImages = mySpreads[i].rectangles;
        var myTotalImageArea = 0;
        var myIndividualImageArea = [];
        for (var j = 0; j < myImages.length; j++) {
            var myImageGeometricBounds = myImages[j].geometricBounds;
            var myImageWidth = myImageGeometricBounds[3] - myImageGeometricBounds[1];
            var myImageHeight = myImageGeometricBounds[2] - myImageGeometricBounds[0];
            myIndividualImageArea[j] = (myImageWidth * myImageHeight);
            myTotalImageArea += myIndividualImageArea[j];
            }
        for (var j = 0; j < myIndividualImageArea.length; j++) {
            alert("Image percentage of total images on spread " + (i + 1) + " = " + (myIndividualImageArea[j] * 100) /myTotalImageArea);
            }
       alert("Total image percentage on spread " + (i + 1) + " = " + myTotalImageArea);
       }
    

Maybe you are looking for

  • When I change albums on my site of Porta Firefox does not update the site well as do other browsers.

    I have a site of Porta by using 'bystander' and when I update the albums he is generally very good, but today I changed the content in 2 albums and even if they are updates on other browsers, the changes are not displayed in my Firefox. I deleted his

  • Appearance of manu favorite

    I'm seeing my favorite sites on my Macbook as a menu under my menu of Safari, as I see them on my iMac, as you can see in the attached image: And I found that I can't find the 'Top sites' option within the general framework on my Macbook Safari prefe

  • E-mail problem

    I send an email to 750 people, keep the email reject, because one of the incorrect addressesis.  Can I ask Outlook Express to send to the valid addresses and let me know who he's not going to?

  • the feel of the thinkpad keyboard...

    Hi all I don't know about you guys, but for those who have used a previous version of as the t500 thinkpad or in my case the w700... the keyboard back then was perfect. the sound of the keys was mild and the return of the keys were equal on each key

  • NEED HELP - forgotten administrative password

    How can I recover administrative password for HP Pavilion zv6000 without losing all the important documents/files/images etc... I'm desperate to get this information, Please HELP!