Mouse position inside a movieclip area

hey
i am trying to solve this problem:
how can i test the position of the mouse inside the area of a specific movieclip WITHOUT using rollover and rollout events?
the movieclip is the irregular shape (star)
i need to do some action according to the position of mouse (inside/outside of the movieclip area) but i can not use rollover event because i have a button placed over the movieclip.
thanks for help

it'll probably be easier for you to change your setup so you can use a rollover/rollout.  otherwise, you have to use a shape-based hittest (check gskinner) or the geometry of your shape.

Similar Messages

  • Mouse Position inside a Frame

    Hallo,
    is it possible to get the position of the mouse relative to the Frame and not to the component where I added the MouseListener?
    kind regards
    Markus

    You could first check where the component starts in the frame and then add those starting coordinates to the coordinates. If there is a faster way to do this please post it

  • Change Mouse Cursor Inside JTextPane

    Hello Everyone,
    I am trying to change the mouse cursor of a specific text of a JTextPane to:
    setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));This specific text is a hyperlink which its color is blue and it is underlined, so I want to have the mouse cursor changed to make clearer that you can click on it.
    I thought about trying to track the mouse position inside the JTextPane until it reachs the text position but I am not aware of any class that provides this feature. Does anyone know or have another ideia?
    Any help is appreciated,
    Thanks in advance
    Edited by: ZeroTodd on Aug 10, 2010 6:26 AM

    This specific text is a hyperlink which its color is blue and it is underlined, so I want to have the mouse cursor changed to make clearer that you can click on it.That's the default behavior (in the default Metal LaF, at least) when you setEditable(false). And IMO it doesn't make much sense to change the cursor or allow hyperlink navigation when the text pane is editable.
    db

  • Mouse position always zero

    Hello!
    I am developing a rather big application in Labview ver 8.2.
    I have a problem with getting the mouse position inside a picture.
    The property node mouse->mouse position always returns (-1, -1) or (0, 0). The (-1, -1) returns if the mouse is positioned over a scrollbar.
    My problem is that the (0, 0) is returned for every position inside the picture.
    Now i  wonder if anybody has any suggestions how to get the mouse position to be returned correctly.
    Best regards
    Erik Johansson

    Are you saying that you cannot reproduce the problem if you reduce it to a very small program (e.g. a loop containing only an image, appropriate property node with indicator and a small wait statement)?
    Where did your code come from? Was it converted from an earlier version or coded from scratch in 8.20? Have you tried deleting the current image indicator and creating a new one?
    LabVIEW Champion . Do more with less code and in less time .

  • Bitmap Rotation According to Mouse Position?

    Hi,
    I am working on a 2d computer graphics project, and I need a good function to rotate a Bitmap 360 degree according to my mouse position.
    for example: 

    Hi,
    I am working on a 2d computer graphics project, and I need a good function to rotate a Bitmap 360 degree according to my mouse position.
    for example: 
    Hello,
    To rotate that image, we need to deal with the following tips.
    1. The image size.
    If the area for that image rotated is not big enough, it will just lose some parts of that image.
    Here is a nice code shared in this thread
    http://stackoverflow.com/questions/5199205/how-do-i-rotate-image-then-move-to-the-top-left-0-0-without-cutting-off-the-imag/5200280#5200280.
    private Bitmap RotateImage(Bitmap b, float Angle)
    // The original bitmap needs to be drawn onto a new bitmap which will probably be bigger
    // because the corners of the original will move outside the original rectangle.
    // An easy way (OK slightly 'brute force') is to calculate the new bounding box is to calculate the positions of the
    // corners after rotation and get the difference between the maximum and minimum x and y coordinates.
    float wOver2 = b.Width / 2.0f;
    float hOver2 = b.Height / 2.0f;
    float radians = -(float)(Angle / 180.0 * Math.PI);
    // Get the coordinates of the corners, taking the origin to be the centre of the bitmap.
    PointF[] corners = new PointF[]{
    new PointF(-wOver2, -hOver2),
    new PointF(+wOver2, -hOver2),
    new PointF(+wOver2, +hOver2),
    new PointF(-wOver2, +hOver2)
    for (int i = 0; i < 4; i++)
    PointF p = corners[i];
    PointF newP = new PointF((float)(p.X * Math.Cos(radians) - p.Y * Math.Sin(radians)), (float)(p.X * Math.Sin(radians) + p.Y * Math.Cos(radians)));
    corners[i] = newP;
    // Find the min and max x and y coordinates.
    float minX = corners[0].X;
    float maxX = minX;
    float minY = corners[0].Y;
    float maxY = minY;
    for (int i = 1; i < 4; i++)
    PointF p = corners[i];
    minX = Math.Min(minX, p.X);
    maxX = Math.Max(maxX, p.X);
    minY = Math.Min(minY, p.Y);
    maxY = Math.Max(maxY, p.Y);
    // Get the size of the new bitmap.
    SizeF newSize = new SizeF(maxX - minX, maxY - minY);
    // ...and create it.
    Bitmap returnBitmap = new Bitmap((int)Math.Ceiling(newSize.Width), (int)Math.Ceiling(newSize.Height));
    // Now draw the old bitmap on it.
    using (Graphics g = Graphics.FromImage(returnBitmap))
    g.TranslateTransform(newSize.Width / 2.0f, newSize.Height / 2.0f);
    g.RotateTransform(Angle);
    g.TranslateTransform(-b.Width / 2.0f, -b.Height / 2.0f);
    g.DrawImage(b, 0, 0);
    return returnBitmap;
    2. The location of that control which displays that image.
    If we use a picturebox, and set its sizemode to autosize like the following line, then if you just want to rotate that image to show, and you don't want to that affects the original image, then we need to keep its center point.
    this.pictureBox1.SizeMode = PictureBoxSizeMode.AutoSize;
    We could add resize event handler after we set image for that picturebox.
            Point pOrign;
            Size sOrign;private void Form1_Load(object sender, EventArgs e)
    this.pictureBox1.SizeMode = PictureBoxSizeMode.AutoSize;
    Image img = Image.FromFile(@"D:\Documents\New folder\New folder\TestImage.PNG");
    this.pictureBox1.Image = img;
    this.pictureBox1.InitialImage = img;
    pOrign = new Point(this.pictureBox1.Left , this.pictureBox1.Top );
    sOrign = new Size(this.pictureBox1.Width, this.pictureBox1.Height);
    this.pictureBox1.BorderStyle = BorderStyle.FixedSingle;
    this.pictureBox1.Resize += pictureBox1_Resize;
    private void pictureBox1_Resize(object sender, EventArgs e)
    this.pictureBox1.Left = this.pOrign.X + (this.sOrign.Width - this.pictureBox1.Width) / 2;
    this.pictureBox1.Top = this.pOrign.Y + (this.sOrign.Height - this.pictureBox1.Height) / 2;
    3. The angle between that center point and your mouse postion.
    We could get that value inside the picturebox's container's mouse_move event.
    Double angleNew ; private void pictureBoxContainer_MouseMove(object sender, MouseEventArgs e)
    angleNew = Math.Atan2(this.pOrign.Y + this.sOrign.Height / 2 - e.Y, this.pOrign.X + this.sOrign.Width/2 - e.X) * 180.0 / Math.PI;
    But when to start rotate that image, it should be your chooice, and you could decide when rotate that image with the following line.
    this.pictureBox1.Image = (Image)RotateImage(new Bitmap(this.pictureBox1.InitialImage), (float)angleNew);
    If you just want to save that change to that image, then you could save that bitmap to file directly.
    Happy new year.
    Regards.
    Carl
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Capture Mouse Position outside an applet

    Dear All,
    I'm working on an applet that needs to know the actual position of the mouse cursor outside its area
    (i.e.: else where on the screen), is that possible?
    Thank you in advance.

    As far as I know, no. Applets know about the mouse only when it's inside the applet area.

  • Charts: how do I determine when the mouse is in the plot area

    I'm trying to implement logic that will do the following:
    Panning plot within plot display area by clicking and dragging mouse
    If the user clicks and drags in the chart plot area (the region where the chart plot actually displays, not including the axes, legends, titles, etc.), I want to be able to provide the effect of panning the plot (e.g. similar to grabbing and dragging a map in Google maps) within the plot display. This makes the most sense, of course, if the user has zoomed in to some level and the entire plot is no longer fully visible within the display.
    Zooming on a plot
    If the user places the mouse somewhere in the chart plot area and uses their mouse wheel, I want to be able to provide the effect of zooming in and out of the plot. The plot area itself must remain at its original size, just the representation of the plot needs to simulate the effect of being zoomed in or out on.
    Thoughts, suggestions, ...
    To make the zoom and pan effect, my thought was to adjust the axes bounds as appropriate to simulate these effects. The trick for some of what I'm planning on doing is finding out where the mouse is in the plot area (not the whole chart) so that I can find the x,y offsets from the plot origin (which appears to be in the upper left - at the chart level anyway). For panning, I don't think I care what the offset is, just that it's within the plot. For zooming, I may need to know where the mouse is in the plot so that the zooming could be centered on that location in the plot. This makes me think that it would also be helpful to find out how to translate the mouse x,y pixel position to a corresponding x,y value in the plot data domain.
    I've been experimenting with attaching event handlers to detect various mouse actions and what information can be gleaned from these events. So far I have not found anything that allows me to determine the bounds of the plot region in the overall chart. I can get the mouse x,y position, but I don't know where it is in relation to the plot area bounds. I don't want to initiate a pan of a plot if the user happens to drag their mouse somewhere outside the plot area (i.e. over an axis, legend, etc.). Also, it would not make sense to start a zoom on the chart unless the mouse is over the plot.
    Please let me know if this seems to be a reasonable approach, and if not, please suggest any ideas for alternatives. Any help, ideas and suggestions regarding how to solve these issues and/or determine this information would be welcome.

    I experimented a bit and it seems the plot-content is the Group containing, well, the content of the plot. So in a line chart it's the smallest rectangle containing all the lines and the graphic at the data point (little circles, by default). What you probably need instead is the chart-plot-background.
    Here's a quick example of a panning chart. There are probably better ways to manage the mouse dragging (it behaves somewhat badly if you drag out of the plot area and then back in, for example) but it gives you the basic idea. My original idea of adding a mouse directly to the plot area failed as the event doesn't get propagated to the plot region if you click on part of the plot content (a line, for example).
    import java.util.Random;
    import javafx.application.Application;
    import javafx.beans.property.DoubleProperty;
    import javafx.beans.property.SimpleDoubleProperty;
    import javafx.collections.FXCollections;
    import javafx.collections.ObservableList;
    import javafx.event.EventHandler;
    import javafx.geometry.Point2D;
    import javafx.scene.Scene;
    import javafx.scene.chart.LineChart;
    import javafx.scene.chart.NumberAxis;
    import javafx.scene.chart.XYChart.Data;
    import javafx.scene.chart.XYChart.Series;
    import javafx.scene.input.MouseEvent;
    import javafx.scene.layout.BorderPane;
    import javafx.scene.layout.Region;
    import javafx.stage.Stage;
    public class PanningChart extends Application {
      @Override
      public void start(Stage primaryStage) {
        final NumberAxis xaxis = new NumberAxis("x", 0, 10, 1);
        final NumberAxis yaxis = new NumberAxis("y", 0, 100, 10);
        final LineChart<Number, Number> chart = new LineChart<>(xaxis, yaxis);
        chart.setAnimated(false);
        chart.setData(createData());
        final Region plotArea = (Region) chart.lookup(".chart-plot-background");
        final DoubleProperty lastMouseX = new SimpleDoubleProperty();
        final DoubleProperty lastMouseY = new SimpleDoubleProperty();
        chart.setOnMousePressed(new EventHandler<MouseEvent>() {
          @Override
          public void handle(MouseEvent event) {
            final double x = event.getX();
            final double y = event.getY();
            if (plotArea.getBoundsInParent().contains(new Point2D(x, y))) {
              lastMouseX.set(x);
              lastMouseY.set(y);
        chart.setOnMouseDragged(new EventHandler<MouseEvent>() {
          @Override
          public void handle(MouseEvent event) {
            final double x = event.getX();
            final double y = event.getY();
            if (plotArea.getBoundsInParent().contains(new Point2D(x, y))) {
              moveAxis(xaxis, x, lastMouseX);
              moveAxis(yaxis, y, lastMouseY);
        final BorderPane root = new BorderPane();
        root.setCenter(chart);
        primaryStage.setScene(new Scene(root, 600, 400));
        primaryStage.show();
      private void moveAxis(NumberAxis axis, double mouseLocation,
          DoubleProperty lastMouseLocation) {
        double scale = axis.getScale();
        double delta = (mouseLocation - lastMouseLocation.get()) / scale;
        axis.setLowerBound(axis.getLowerBound() - delta);
        axis.setUpperBound(axis.getUpperBound() - delta);
        lastMouseLocation.set(mouseLocation);
      private ObservableList<Series<Number, Number>> createData() {
        final ObservableList<Data<Number, Number>> data = FXCollections
            .observableArrayList();
        final Random rng = new Random();
        for (int x = 0; x <= 10; x++) {
          data.add(new Data<Number, Number>(x, rng.nextDouble() * 100));
        return FXCollections.singletonObservableList(new Series<Number, Number>(data));
      public static void main(String[] args) {
        launch(args);
    998038 wrote:On a slightly different (but related) subject, where can I find an up-to-date source of information that describes the IDs and class names that JavaFX uses? I assume the ".plot-content" is pertaining to the ID of the chart plot area (or plot "child" of the chart?). Where can I find the names of the various objects that can be "looked up"?I generally try to avoid lookups as they feel a bit fragile. However occasionally there seems to be no other way, as in this case. The [url http://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html]CSS reference guide documents the css class substructure of each Node type.

  • How to change the mouse cursor icon type when mouse moves out of client area ( propertysheet) WTL?

    I got stuck with an issue in property sheet .I want to load different cursor when the mouse position is within the client area and load another when moves out of the client area.
    In the porpetysheet I added four page. In the first page when I click next I am loading cursor of IDC_WAIT type and loading IDC_ARROW when the mouse moves out of the client area.
    In the page class I triggered the event for WM_MOUSEMOVE as follow:
        MESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove)
    LRESULT OnMouseMove(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
    if(TRUE == m_bIsNextBtnClicked)
    ::SetCursor(LoadCursor(NULL, IDC_WAIT));
    else
    ::SetCursor(LoadCursor(NULL, IDC_ARROW));
    return TRUE;
    This event is getting triggered and absolutely had no issue with this. Similarly I tried adding `MESSAGE_HANDLER(WM_MOUSELEAVE, OnMouseLeave)` this event making an assumption that this will get triggered if the mouse moves out of the client area,  but
    this event did not get triggered at all.If this is not the mouse event to be triggered for mouseleave which event should I trigger?
    LRESULT OnMouseLeave(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
    ::SetCursor(LoadCursor(NULL, IDC_ARROW));
    return TRUE;
    Now when I click Next button , **I was actually calling a function which is taking sometime to return** . Before to this function I am loading IDC_WAIT cursor i.e., 
     `::SetCursor(LoadCursor(NULL, IDC_WAIT));` . 
    Now when move the mouse cursor on to the non-client area I want to load IDC_ARROW cursor i.e., 
        ::SetCursor(LoadCursor(NULL, IDC_ARROW)); 
    When the moves on to the non-client area I am handling the mouse event in sheet derived class as follows,
    MESSAGE_HANDLER(WM_NCMOUSEMOVE, OnNCMouseMove)
    LRESULT OnNCMouseMove(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
    ::SetCursor(LoadCursor(NULL, IDC_ARROW));
    return 0;
    This event is not getting triggered until unless the function in the Next button event is executed.
    I want both of them to be done in parallel i.e, click Next button now hover mouse on the client area, Busy icon should come and when mouse moves out of the client area then IDC_ARROW icon should come.
    LRESULT OnWizardNext()
    ::SetCursor(LoadCursor(NULL, IDC_WAIT));
    m_bIsNextBtnIsClicked = TRUE;
    BOOL bRet = MyFun();
    m_bIsNextBtnIsClicked = FALSE;
    //Until this function(MyFun()) is executed **WM_NCMOUSEMOVE**
    //event is not getting triggered.But this event should get triggered and I
    //should be able to see the change of cursor within and out of client area.
    Can anyone kindly help me to solve this issue.
    SivaV

    Hello
    sivavuyyuru,
    For this issue, I am trying to involve someone to help look into, it might take some time and as soon as we get any result, we will tell you.
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Zooming image from mouse position(like in  windows vista photo gallery)

    hello all;
    here's my situation, hope someone can help..
    i wanna Zoom an image, which zoom from my mouse position
    like in windows photo gallery in windows vista
    so i do this..
    g2.translate(iMoux,iMouy);       
            g2.scale(zoom, zoom);       
            g2.translate(-iMoux,-iMouy);       
            g.drawImage(icon.getImage(), iSposx, iSposx, d.width/2-iValue, d.height-iBawah, null);
            g.drawImage(icon2.getImage(), d.width/2, iSposy, d.width/2-iValue, d.height-iBawah, null);the problem come when i move my mouse to the different location (like from top right to bottom left)
    the zoom image displayed in the screen like jump from latest location to new location
    anybody can help me...a clue how to do that?
    thx appreciate your help guys
    mao
    Edited by: KingMao on 31 Mei 08 14:27

    Hi Frank.
    Thanks for the response.
    Agreed, the pertinent question is why can't my colleague edit the JPG exported by Aperture. It's probably also worth pointing out, the same problem occurs with JPGs exported from iPhoto.
    The Windows software usually plays nicely with JPGs by all acounts, just not the ones I send - which I do via eMail or my public space on Mobile Me incidently.
    So, another key question is: all settings being equal (color profile, quality, etc.) are the JPGs as produced by iPhoto and Aperture indistinguishable from those produced by other apps on other platforms - i.e. does the use of JPG enforce a common standard?
    If that is the case, I suspect ours might be a permissions issue.
    According to the Microsoft support page on editing in Windows Live Photo Gallery, the inability to edit a picture is commonly caused by unsupported file type, or read-only attribute set on the file.
    Unfortunately, he and I are not in the same place, and he's not particularly au-fait with this type of problem solving. Hence, before involving him, I'd like to know:
    1. it's possible (i.e. someone else does it), and,
    2. what's involved (at my end and/or his).
    Thanks again,
    PB

  • System not sensing mouse position

    Starting today, my computer (iMac G5 PPC) no longer senses the position of my mouse pointer. For instance:
    - The dock doesn't magnify when the mouse is in it
    - None of the corners activate things like screensaver, expose, desktop
    - When I select a menu in the menu bar, moving the mouse over another menu item doesn't open that menu.
    In other words, OSX simply has no clue where my mouse pointer is located as I move it for all those neat automatic things. Yet, I can still use the mouse to click on items to make them work, then OSX knows where the mouse is.
    I've rebooted several times to no effect, but did notice something. As apps start up, the instant a window opens, OSX will sense the mouse position for that brief moment. For example, putting the mouse over the dock doesn't magnify, but when an app window appears, the dock will magnify that very instance. Moving the mouse out of the dock area doesn't unmagnify the dock, it's stuck in that state until either another window opens, causing OSX to sense the new position, or I click any mouse button which all gets OSX's attention and senses the mouse position.
    The pointer never changes when I'm over things like Links.
    Strange stuff. The mouse moves fine, it's just not being detected as it moves.
    Now, yesterday I installed a new ScanSnap scanner with the ScanSnap Manager software and Acrobat Standard ver. 7. But the mouse didn't have this behavior yesterday, or even this morning. This strange problem just appeared out of the blue mid-day today.
    I've since used Disk Utility and Onyx, and re-installed the 10.4.9 update. I switched to another user account, no difference, so it's definitely system wide.
    This doesn't stop me from using my iMac, but I just don't know how to fix this mouse issue besides a OSX re-install.

    Ok everybody, I finally got proper behavior, it's just too bad I'm not sure of the procedure.
    When I go to bed I usually run the mouse pointer to the upper left corner to activate the screensaver. Of course it didn't work. But I also knew that clicking a button causes the mouse to be sensed, so I was pushing some of the buttons while in the corner to see if I could get the screensaver going.
    Well, after doing this, everything is back to normal operation again. So, I fixed it totally by accident. Makes me wonder if there's some features that are turned on and off somehow by doing whatever it was I did up in that corner.
    Just so you know, I use a Logitech Cordless Optical Trackman. I swapped to the original Apple corded mouse but that made no difference.
    I never had a chance to try the suggestions since I just read them before posting this.
    Anyway, I hope I don't do again whatever it was that caused the behavior, but I am going to store this info in DEVONthink just in case something like this happens again.
    Anyway, it would still be interesting if someone could shed some light on this fix I accidently found. Perhaps some hidden capabilities/features? Or just dumb luck?

  • AS3 loading external swf files with buttons from inside a movieclip

    In my main .swf I have labels on the timeline, navs for those btns are on the first frame of the AS layer and each button sends the playhead to a different frame.
    On one frame called fr1 there is an mc called mc_1 that appears on stage when the playhead stops there. Inside mc_1 are a set of navigation buttons that need to call external .swfs.
    Do I add event listeners on the last frame of mc_1 for each button?
    how do I call the loaders for the swfs on the buttons since the swfs will load on the main timeline NOT the mc_1 timeline?
    So label on main timeline called fr1 will load external1 swf , on fr10 external 2.swf will load and so on.
    any help?

    The code for that button's event listener needs to be placed wherever it has direct access to the button.  Not necessarily on the same timeline, but in a place where both the button and the code are present at the same time.
    The code could be placed at the frame in the main timeline where the movieclip with the button(s) is, targeting the buttons via the movieclip (mc.button.addEvemtListener...) , unless the buttons are somewhere down the timeline of that movieclip.
    If they are down the timeline of that movieclip, then you would need to have the event listener also inside the movieclip, down its timeline where the buttons are finally settled in... being sure to assign instance names to the buttons at every keyframe.

  • MAC OS X + stage.fullScreenSourceRect + renderMode set to GPU = problem with mouse position

    When setting stage.fullScreenSourceRect, stage.displayState to StageDisplayState.FULL_SCREEN_INTERACTIVE; and renderMode to GPU, mouse position is read incorrectly. This is not only for mouseX and mouseY position, but also all the mouse interactions with Sprites, Buttons etc are not working correctly.
    Anybody know a solution for this issue?
    Here is the bug reported, but there is no response yet.
    https://bugbase.adobe.com/index.cfm?event=bug&id=3486120
    Greg.

    Bump up.
    Anybody has the same problem and have an idea how to fix it? Or please just check if you have the same problem.. I'm going to submit my game "Amelia and Terror of the Night" (successfully added to iOS store) to MAC App Store but can't do it while this problem appears.
    I am disappointed nobody  even verified the bugs I submitted at  the bugbase.adobe.com for AIR 3.5 and 3.6
    thanks
    Greg

  • Detect Mouse Position?

    I can't (within actionscript 3) determine where the mouse is
    relative to the flash player window.
    I can get stage.mouseX and stage.mouseY but those coordinates
    are in relation to the size of the entire ORIGINAL stage at compile
    time.
    I need to know where the mouse is in relation to the window
    playing the swf, which is significantly smaller than the original.
    That is the play screen has been resized.
    If I zoom way in and scroll to the right edge of the stage
    and mouseover a spot on the right edge, then trace the mouse
    position (in a mouseover event proc) it shows me a number that is
    the width of the ORIGINAL stage. It seems to be completely
    oblivious to the play window.
    Is there any way at all to determine where the mouse is
    relative to the play window?
    For example,
    if the original stage is 1350 and the play window is 540 and
    I'm zoomed WAY in and scrolled all the way to the right and
    I put the mouse directly in the middle of the window,
    I need something that tells me (in actionscript 3) that the
    mouse's x coordinate is at 270, NOT 12XX (somewhere near the end of
    the orginal size of the stage).
    Is this possible in Flash C3??

    Hi there!
    I don´t know if it´s right but have you tried
    localX
    localY
    from the occuring MouseEvent?
    Hope that helps :)
    CU
    Ingo

  • Convert mouse position to image position

    Using a zoomed IMAQ image in an image control, I want to recover the position of the mouse in the co-ords of the underlying image. LastMousePositionX (and Y) give the info I want but they are one click in the past and not the current position. Amazingly, there doesn't appear to be an equivalent CurrentMousePositionX. I can't seem to find the info I need to do the conversion manually. The mousedown event returns the current mouse position and I can get the position in the image container by subtracting off its left and top position. But to convert this to the image position I need to know both the zoom and where the images origin is relative to what is displayed. I can't seem to find that origin position in the list of property nodes. The only thing I can seem to come up with is to extract the info from teh image information string, but this seems like an incredibly poor way to extract such obvious information - espeically since the info must be calculated to put in the string anyway. Can anyone help with this?

    Hi,
    I am confused why you get the mouse position one click in the past because it seems to work ok for me. I've had to use four of the image properties to recreate the effect using the mousemove event, but this seems to give the same values as the Last Mouse Position property so I think it does what you want. I couldn't see an origin property so I did the conversion using the position given at the image center. I wanted to post a snippet here but I'm new to posting and couldn't seem to get it to work for the whole block diagram, so I'm using a screenshot instead. I hope this helps in some way.
    Will
    Attachments:
    mouse position test.vi ‏58 KB

  • Get mouse position during Custom UI Draw event?

    I am building a Custom UI for one of my plugin effect.
    I want to get the mouse position during the Custom UI Draw event (PF_Event_DRAW), but cannot manage to get it.
    From what I understand, it seems we can only get the mouse position during the events PF_Event_DRAG, PF_Event_DO_CLICK, and PF_Event_ADJUST_CURSOR.
    I tried to use PFAppSuite4::PF_GetMouse() too, but this resulted in the error message "After Effects error: internal verification failure, sorry! {PF_GetMouse can only be called during valid events.}".
    Therefore I want to store the mouse position during PF_Event_ADJUST_CURSOR, and use it later during PF_Event_DRAW.
    Where can I store those values in a "clean" way (ensuring there will not be conflicts if two instances of the same effect are running, etc)?
    Or is there an easier method to get the mouse position during a Custom UI Draw event?

    //SequenceDataVars is the name of your data structure
    //this is how you create the sequence data
    out_data->sequence_data = PF_NEW_HANDLE(sizeof(SequenceDataVars));
    SequenceDataVars *seqData =
    (SequenceDataVars*)PF_LOCK_HANDLE(out_data->sequence_data);
    //and now you can store stuff in it.
    seqData->var1 = 7;
    //after it's created, on other calls, you just do a simple cast
    SequenceDataVars *seqData = *(SequenceDataVars **)out_data->sequence_data;
    seqData->var1 = 100;
    //this is how you delete it. (if you don't delete it, it will be saved with
    the project, and loaded on the next session. (if you want)
    PF_DISPOSE_HANDLE(out_data->sequence_data);
    there's more to know, so look up SequenceSetup, SequenceSetdown, ect in the
    sample project.

Maybe you are looking for

  • DUMP in the MFBF transaction

    Hi Folks, Users getting the frequent dumps in production systems. actaully we observed that dumps are coming when the users accessing the MFBF transaction manually when the batch job was running for backflush and NRIV (number ranges) table is getting

  • School diary in Indesign for DPS

    Does anyone know if you can create a reliable school diary in Indesign for DPS that can be used for daily planning and reminders?

  • Add username token to SOAP Service in ESB

    I know how to add the username token to a partnerlink in a bpel process but how can I configure the same soap headers in a SOAP Service in ESB? Another question about the configuration of a bpel process when invoking a secure web service: I need to a

  • Changed web hosting companies/mail server

    I just changed web hosting companies and want to know if I change the "incoming" and "outgoing" server to the new server addresses will I lose the emails that I have for this account? Said another way, I'm going to open mail preferences, select the m

  • I bought a Lexmark 8300 printer but it wont work on my mac

    I would like to see if I could get this to work on my mac. any thoughts? iMac G5 20 Mac OS X (10.4.2) iMac G5 20   Mac OS X (10.4.2)