Problem using 2 ImageViews (one normal, one zoomed) on an image

Hi, I've a problem in using 2 imageviews on an image.
Imageview A displays an image, and it has been flipped using "scaleX = -1"
Imageview B displays the same image as a zoomed image using viewport with "scaleX = -1"
Unfortunately, Imageview B now displays the far right-hand side of image, insteads of the left-hand side.
package imageview;
import javafx.geometry.Rectangle2D;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.HBox;
import javafx.scene.paint.Color;
import javafx.scene.Scene;
import javafx.stage.Stage;
var image = Image {
    url: "{__DIR__}flower.png"
var ivA = ImageView {
    image: image
    scaleX: -1
var ivB = ImageView {
    image: image
    fitWidth : 0
    fitHeight : 0
    viewport: Rectangle2D {
        minX: 0
        minY: 0
        width: 100
        height:100
    scaleX: -1
Stage {
    title: "ImageView"
    width: 415
    height: 200
    scene: Scene {
        content: HBox {
            content: [ivA, ivB]
}

Well, I asked for a mock-up of the wanted view, not the real one which I saw already (using my own image)... :-)
But I think I understood want you want. The problem is that you have to set the viewport position according to the image size, but this one is available only after loading it, ie. after the scene is already computed. And the Rectangle2D is immutable, you can't bind the variables.
I solved this by updating the viewport after a click.
Maybe we can track the image loading completion with using on replace on 'progress' or just 'width'.
var image = Image {
    url: "{__DIR__}flower.png"
var fullView = ImageView {
    image: image
    scaleX: -1
var zoomedViewSize = 100;
var zoomFactor = 1.0;
var zoomedView: ImageView = ImageView {
    image: image
    fitWidth : 0
    fitHeight : 0
    viewport: Rectangle2D {
        minX: 0
        minY: 0
        width: 100
        height:100
    scaleX: -1
    onMousePressed: function (evt: MouseEvent): Void
        zoomedView.viewport = Rectangle2D {
            minX: image.width - zoomedViewSize
            minY: 0
            width:  zoomedViewSize
            height: zoomedViewSize
        zoomedView.requestFocus();
Stage {
    title: "ImageView"
    width: 415
    height: 200
    scene: Scene {
        content: HBox {
            spacing: 10
            content: [ fullView, zoomedView ]
}[EDIT] OK, it works with:
var wdth = bind image.width on replace
    if (wdth > 0)
        zoomedView.viewport = Rectangle2D {
            minX: image.width - zoomedViewSize
            minY: 0
            width:  zoomedViewSize
            height: zoomedViewSize
}Note that this variable definition must be after the zoomedView definition... The order of initialization is important here.
Edited by: PhiLho on 1 oct. 2009 13:27

Similar Messages

  • SAP Crystal Reports data source connection problem using sap business one

    Hi,
    I m facing a problem regarding: SAP Crystal Reports data source connection problem using sap business one
    I am trying to create a Crystal report but when I try to configure a new connection it does not work.
    I select Sap Business One data source and try to complete the information required to connection but it does not list my companies databases, what is the problem?
    Our Current SAP related software details are as follows:
    OS: Windows Server 2008
    SAP B1 Version: SAP B1 9 (902001) Patch 9
    SAP Crystal Report Version: 14.0.4.738 RTM
    Database: MS SQL Server 2008 R2
    I have also added some screenshots of the issues.
    Please have a look and let me know if you have any questions or any further clarifications.
    I m eagerly waiting for a quick and positive reply.

    Hi,
    There is problem with SAP Business One date source.
    I had faced same problem, I used OLEDB Data-source, and it worked fine for me.
    So, try to use OLEDB.
    Regards,
    Amrut Sabnis.

  • Problem Using more than one patchset for Kernels

    I'm using vanilla 2.6.10 sources, with the -mh4 bluetooth patch, but I also want to apply the -as patch, as Arch has now adopted it for the standard kernel. So I have the following lines in the PKGBUILD:
    ##### Apply any patches here, if you set the patch variable above uncommment the following line
    patch -Np1 -i ../patch-2.6.10-as5 || return 1
    patch -Np1 -i ../patch-2.6.10-mh4 || return 1
    and I have the patches downloaded into the build directory. When I run makepkg, I get a HUNK FAILED error at the patching stage, and makepkg aborts. If I run it with the -mh4 patch only, it works OK.
    I realise this is nothing to do with the PKGBUILD, which I am sure will produce a uniquely-named package in about 30 minutes or so. Would you have any general advice regarding the use of more than one patch?

    yeah - i have done this with a few patchsets.  it's easy if you know what you are doing.
    i'll explain what is happening just in case you don't know - all patches are created based on the original code and work by matching existing code and replacing it with new code - if you apply one patch then another the first patch may alter some of the references that the second patch is try to match - so it fails.  what you need to do is to check where it has failed.
    it will say patching core.c or something and the it will say HUNK FAILED - that means the first patchset changed the core.c code and the second patch can't find what it is looking for.
    you then need to open the first patch - find out where core.c was changed and how and then open the second patch to see what it now needs to look for and then you'll then have to make new diffs to finish the process or eidt the old diffs (which is tricky but shorter)
    it ain't easy.  if you have more than a few hunk failed don't even bother - there is no guarantee that they patches will provide a build-able kernel.
    this whole process lies at the core of creating these massive patchsets - if you can combine both patchsets and get a successful build out of it you can consider yourself a novice kernel hacker. it can be done.
    i can't help much more than that i'm afraid - i'll ask cactus to split these two posts too a new thread for you

  • Problem using the IMAQ Extract function.Not getting two different image out

    Hi, I am trying to use the multiple IMAQ extract functions to get certain parts of the webcam image and then using the color extract function to get the average RGB values. The problem is that both the IMAQ extract functions give the same image on its output port. The block diagram snippet and VI are attached below. Also, please let me know if there is a better way of doing this. I need to expand this later to extract rgb values of about 40-50 different parts of the image instead of just two shown below.
    Solved!
    Go to Solution.
    Attachments:
    Extract RGB Data.vi ‏104 KB

    You did not create another image that you should wire to the input "Image Dst" of "IMAQ Extract".  That's why you always operate on the original image (which you should not do if you intend to operate on several regions of the image).
    Solution: 
    (1) Create a new image and wire this to "Image Dst".
    (2) Apply the histogram operation sequentially (e.g. in a loop).
    That way you will notice, that Image Dst contains actually(!) the region you have specified.  (Put a probe on the image wire that goes from the Extract VI to the Histogram VI).

  • I created one apple I'd when I started using the iPad.  After some days, I had to create a new apple I'd as there was some problem with the first one. Now at some places still my old apple I'd is appearing.  Pls adv how I change this to my new apple Id.

    I created one apple I'd when I started using the iPad.  After some days, I had to create a new apple id
    as there was some problem with the first one. Now at some places still my old apple Id is appearing.  Pls adv how I change this to my new apple Id.

    Anything you downloaded with the first Apple Id will forever be tied to it, and will always require it to update.
    The question here is, why did you think you needed to create a new Apple ID? What was the problem with the first one?
    To get rid of th old one, you'll need to delete everything you downloaded with it, and then sign out of the ID in several places around the iPad. 
    Go to Settings->iTunes & App Stores->Apple ID->Sign out.
    Repeat the process, for Facetime, Messages, Mail and any other App you need to sign out of.

  • OS is Mountain Lion, upgraded no problems, used an external Hard drive for my time machine, now my iPhoto will not show any of my photo's or ay new ones I import! Help please!!

    OS is Mountain Lion, upgraded no problems, used an external Hard drive for my time machine, now my iPhoto will not show any of my photo's or ay new ones I import! Help please!!

    Do you get this window when you hold down the Command+Option keys and launch iPhoto?
    If not then you're not holding down both keys long enough.
    OT

  • I am having the  problem . it says it shouldnt take more than 3 minutes then i get this message Could not activate iphone. i have taken the sim card out and put it back in even then its of no use. if any one out there can help us it would be very nice

    i am having the  problem in my 3gs iphone. it says it shouldnt take more than 3 minutes then i get this message Could not activate iphone.
    i have taken the sim card out and put it back in even then its of no use.
    if any one out there can help us it would be very nice of them. thank you for your time.

    I can not get to iPhone screen, so no way to get to Settings. That is the problem. When I connect phone to iTunes I get screen asking to insert SIN card. On the phone I'm getting Cinfigure screen asking Launguage , Country or Region, Wi-Fi, ( I can connect to my home wi-fi), and last screen "Activating your iPhone". After two minutes of waiting IM getting message: Your iPhone could not be activated because the activation server in temporary unavailable. try connecting to iTunes or try later or contat apple.com/support.
    Like I mention, I went to Bell as well Rogers store and tried to insert active SIM card with no results.
    Yes, my friend unlock the phone to use with Rogers but I don't know where

  • I am not getting any sound input on my microphone. There is no microphone input on my new macbook pro, so I am using my old one. Is this a problem with the new operating system? Did they simply remove any microphone software?

    I am not getting any sound input on my microphone. There is no microphone input on my new macbook pro, so I am using my old one. Is this a problem with the new operating system? Did they simply remove any microphone software?

    Check System Preferences > Sound > Output
    Make sure the correct device is selected.

  • Having problem deleting all but one particular mail from the iPhone 4S mail inbox. I can delete mail either by the trash can or using edit, selecting the mail message and deleting.  However there is this one mail message that will not go away. Any ideas?

    I am having a problem deleting all but one particular mail message from my inbox. I delete by either using the trash can icon for individual mail, or using edit, selecting the mail message (s) and clicking delete.  However there is this one mail message that will not go away regardles of what I do including deleting all from the trash.  Any ideas?

    I get that every once in a while on my 3GS, and that's what I do to get rid of it. Probably not a bad idea to power down the phone every so often, anyway, gets rid of any crud waiting to cause a bug.
    Glad to hear that it worked for you.

  • SOS problem using one Entity bean for editing records. please help me

    Hello
    I have one great problem using one entity bean 2.1 and i am working with this problem several days and i dont solve it.
    i am using this jb 2.1 for add new records to one oracle database and for editing records.
    I have one great problem for editing records
    I have one objets that is as one of my database table. (PersonaObj.java)
         //personaObj.java
         public class PersonaObj implements Serializable{
              private Integer id_persona; //this ishte database table autonumeric
              private java.lang.String nombre;
              now the set/get methods.
         One field of this objets (bean) is the primary key of the table, and this field is one part of the pk from the entity bean.
         From one session bean i call the entity bena passing the objet
         into the entity bean (interface) i have one methods:
              public getPersona getT56aaat04();
         public void setPersona(PersonaObj obj);
         into the entitybean bean i have:
         public PersonaEntityPK ejbCreate(PersonaObj obj) throws CreateException {
              this.setT56aaat04(obj);
              public abstract Integer getId_persona();
         public abstract void setId_persona(Integer Id_persona);
         public abstract java.lang.String getNombre();
         public abstract void setNombre(java.lang.String Nombre);
         public PersonaObj getPersona() {
              PersonaObj obj = new PersonaObj();
              obj.setId_persona(getId_persona());
              obj.setNombre(getNombre());
              return obj;
         public void setPersona(PersonaObj obj) {
              setId_persona(obj.getId_persona());
              setNombre(obj.getNombre());
    But i have one graet problem.
    adding new record to the database i runs well but if i want to edit one recor appears this error:
    => Error <=
    java.rmi.RemoteException: EJB Exception: ; nested exception is: javax.ejb.EJBException: EJB Exception: : java.lang.IllegalStateException:[EJB:010144]The setXXX method for a primary key field may only be called during ejbCreate.
    at PersonasEJB_a43o8n__WebLogic_CMP_RDBMS.setId_persona(PersonasEntityEJB_a43o8n__WebLogic_CMP_RDBMS.java:328)
    at PersonasEntityBean.setPersona(PersonasEntityBean.java:114)
    at PersonasEntityEJB_a43o8n_ELOImpl.setPersona(PersonasEntityEJB_a43o8n_ELOImpl.java:45)
    at PersonasSessionBean.editarPersona(PersonasSessionBean.java:849)
    at PersonasSessionBean_bszo9t_EOImpl.editarPersona(PersonasSessionBean_bszo9t_EOImpl.java:208)
    at PersonasSessionBean_bszo9t_EOImpl_WLSkel.invoke(Unknown Source)
    into the session bean i make this (the session recibes one PersonaObj obj):
    T56aContactosEntityLocal personaLocal ;
                   try {
                        personaLocal = personaHome.findByPrimaryKey(new T56aContactosEntityPK(obj.getId_a04()));
                        T56aaat04Obj objTmp = new T56aaat04Obj();
                        objTmp.setAp1_a04(obj.getAp1_a04());
                        objTmp.setEstado_a04("false");
                        personaLocal.setT56aaat04(obj);
    Please can you help me to solve this problem?

    Hello Werner,
    The mappings seem to be alright at a first glance.
    Have you tried out un- and redeploying your application? Sometimes values appear to be cached in the server. So if you have deployed the application before you entered DB_BANK as alias this might solve the problem...
    BR
    Daniel

  • Remote Interface problem using Sun ONE App & web server

    HI,
    1) I am using an S'less SB. I have local & remote interfaces. I am using the sun one appserver7 & the sun ones's htttp server. By default it doesnt pick up the remote interfaces is it ? How do i make my remote interfaces work ? what are the changes required in config/xml ?
    2) However i changed my client code (i.e my action class which is called by the struts action servlet ) to access the localhome rather than the remote home, but then i get java.lang.classcastexception.
    pls help !
    sanjay

    Hi parsuram,
    Thanks for the tip. After looking at the sample source code, I did finally figure out the solution - so I'll post it in case anyone else happens to be working with websphere studio has the same issue deploying on sun one.
    To access local interface ejb, you must have the following
    1. ejb-local-ref tag in the ejb-jar.xml like so underneath the <session> or <entity> tag of the bean which you plan to access the local ejb with.
    <ejb-local-ref>
    <ejb-ref-name>TestL</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local-home>memory.simple.TestLLocalHome</local-home>
    <local>memory.tool.simple.TestLLocal</local>
    <ejb-link>TestL</ejb-link>
    </ejb-local-ref>
    2. similar ejb-ref tag in sun-ejb-jar.xml
    <ejb-ref>
    <ejb-ref-name>TestL</ejb-ref-name>
    <jndi-name>localejbs/module_memory.betaEJB/TestL68640023372300293</jndi-name>
    </ejb-ref>
    note: sun generates the <jndi-name> and overwrites whatever you put in that tag no matter what you put in there.
    3. here is the code to access
    Context initial = new InitialContext();
    TestLLocalHome tlHome=(TestLLocalHome) Initial.lookup
    ("TestL");
    //the string must match <ejb-ref-name> underneath <ejb-local-ref>
    4. note that the jndi name for the local interface bean becomes irrelevant. only the <ejb-ref-name> in the ejb-jar and sun-ejb-jar matter. furthermore, both <ejb-ref-name> must be the same or you won't be able to deploy.
    5. This is completely my fault for not checking the "proper" way to access local interfaces. in websphere, they let you get away without the ejb-ref tags and just use the string "local:/TestL"!
    -matt

  • Problem: i want to use the Nokia ones while listen...

    Hi, I bought a Nokia 5300.
    I noticed that to get the FM Radio working i have to insert an enhancement (AD-50) into the side of the phone (this was supplied in the box)
    Now i want to plug in my (Nokia HS-47) headphones (which was also included in the box). Where do i plug this into?
    -Because the port where i usually plug it into is now occupied by the FM enhancement.
    -And it is too thin to fit properly into the enhancement.
    PS. If i use standard headphones the 3.5mm ones. I can plug it into the FM enhancement. But i want to use the Nokia ones while listening to the FM radio.
    Can this be done???
    Do i need a special adaper for my nokia headphones?
    Should this already be supplied in the box?
    Please help I have no clue!

    just use the Nokia headphones without the 3.5-2.5 converter piece (which you seem to call "enhancement" ).
    I mean, just try it.Message Edited by fred_be9300 on 01-Nov-200702:43 AM
    My Nokia history: 5310 (Sep 2008), 5300 (Jan 2007), 6610 (June 2003), 3310 (2001)

  • I was using photoshop CC as normal, when suddenly it started going haywire. It has corrupted all the one PSD files by distorting the images and colour. Does anyone know how to recover the original images?

    I was using photoshop CC as normal, when suddenly it started going haywire. It has corrupted all the open PSD files by distorting the images and colour. They are now completely unrecognisable and unusable. Does anyone know how to recover the original images as I was saving them as I went along but the files are now corrupt?

    What version of Photoshop are you running?
    I've seen a couple of instances over the last week or two where Photoshop has added masks, strange colours and also merged content from two separate PSD files that were open at the same time.
    This has occurred on two different iMacs, (both 10.10.x) running Photoshop CC 2014.2.2 (20141204.r.310 x64).
    see image below for example:

  • Aperture 3 shuts down every time I try to use it after only using it for one minute. Aperture closes then a pop up screen asks if I want to reopen Aperture. If somrone at Aperture didn't keep pushing a stop button for it to close,it wouldn't need to ask t

    Aperture 3 shuts down every time I try to use it after only using it for one minute. Aperture closes then a pop up screen asks if I want to reopen Aperture. If somrone at Aperture didn't keep pushing a stop button for it to close,Apple wouldn't need to ask the stupid question"Do you want to reopen Aperture?" to begin with. Anyone out there having the same annoying problem?? I like Aperture or used to anyway,but if this nonsense continues, I will be forced to buy some other editor besides "No hanging fruit - Adobe photoshop CS5" or "I don't like you so I'm shutting down - Aperture".

    Hello,
    sorry to hear about your troubles, but we will need to have more technical information about your problem to be able to help you:
    There may be several reasons that can cause Aperture to crash on start up:
    You may have imported an image (or video) in an encoding that Aperture does not support, or that is larger than 2 GB, or that is corrupted and Aperture cannot process it
    Your Aperture Library or Preferences may have been corrupted
    Or you are having a system wide problem with your machine.
    Or you may simple be running out of disk space.
    It would help, if you could post the crash log from your last crash. Also, more details on your Aperture Library: Is it managed or references? how large is it? Is it on your system drive or on an external drive?
    What have you done, shortly before the trouble started? Have you imported new images or videos? Did you install any plug-ins or any new software, lile Final Cut?
    Try, if you can get Aperture to launch, if you defer the generation of Previews: Hold down the SHIFT-key immediately after you start Aperture to prevent preview generation for that session. If a damaged image in your library is preventing normal opening, this may allow you to start Aperture. If this succeeds, try to identify the broken image or video among the images you recently imported and remove it from the library.
    Regards
    Léonie
    Don't you think your user name is a little bit tactless in an Apple provided forum?

  • Can I use more than one Apple ID on one device

    I have seen some answers to this type of question before but not that since the ios 6 so will ask again. My household shares an Apple ID and it has worked great as we have added devices and purchased apps.  My problem now is this, we have hit a point where I have work things on my iPad and iPhone that I really don't need to be shared with the whole family but it isn't a major deal or security risk. I don't want to give up the advantages of having the household ID.  Is there an easy way to have another ID on my iPad and switch between them without having major complications?  I am for the most part a techie so not afraid of these kind of things but I can't afford to lose everything right now and take the time to set it all back up so getting advice here.  Thanks in advance for any help you can give.

    You can use more than one apple id, but keep in mind that when apps need updating that you'll will need to sign in with correct credentials to update them.
    Share an apple id for the itunes and app stores, but keep your own for icloud, facetime and messages.
    Managing and Sharing multiple id's with your family
    http://www.macstories.net/stories/ios-5-icloud-tips-sharing-an-apple-id-with-you r-family/

Maybe you are looking for

  • Remote Control no longer works

    Sometime in the past year, my apple remote stopped working with my Macbook Pro. None of the buttons work 99% of the time. It used to be that just clicking the menu button on the remote took me to Frontrow, but this doesn't work anymore. Once in a gre

  • Updating Creative Cloud Desktop failure? It can't install as it thinks there are multiple versions?

    As I signed in to Creative Cloud on my desktop,there was a little pop-up bubble from its toolbar icon (I use Windows 7 if that helps at all) saying there is a new update avaible,so it closes the Creative cloud window & quits the app,I press the bubbl

  • FW CS6 Align tool not working properly with lines of text

    Much to my surprise the align tool is not aligning properly with text and I'm not sure what the issue is. My snap to grid distance is set at 1 in preferences. Task: Left-align several vertically-stacked lines of type using the alignment tool. All lin

  • Airport express just stopped extending the network

    I have an airport express that I have been using for 3 years to extend the network in my house. All of a sudden it started flashing amber. I've tried soft resets, hard resets, factory resets, and I can't get it to extend the network anymore. I have 3

  • How to stop the logonServlet

    When I run a web dynpo application and go directly to the application url (http://myserver:50000/webdynpro/dispatcher/local/TutWD_OnlineInteractiveForm/OnlineInteractiveFormApp) the view is rendered without forcing authentication, but if I go to the