ImageView ScrollView scaling

Hi all, my picture is much bigger than the size of the screen and is the scale good onPinchUpdated signal (), but after that it's normal size. How correct scale in the ScrollView? Because without ScrollView, it works fine. Here is my code:

ScrollView {
  id: myScroll
  ImageView {
    id: myImage
    property double initialScale: 1.0
    property double scaleFactor: 0.8
    imageSource: "asset:///images/bigpic.jpg"
    gestureHandlers: [
      PinchHandler {
        onPinchUpdated: {
          myImage.scaleX = myImage.initialScale + ((event.pinchRatio - 1) * myImage.scaleFactor);
          myImage.scaleY = myImage.initialScale + ((event.pinchRatio - 1) * myImage.scaleFactor);
         }
      }
    ]
  }
  scrollViewProperties {
      ScrollMode: ScrollMode.Both
  }
}

You can use the pinchToZoomEnabled property... and let the scaling to the BONE

 ScrollView {
            scrollViewProperties {
                scrollMode: ScrollMode.Both
                pinchToZoomEnabled: true

            }

.........................

}

Tags: BlackBerry Developers

Similar Questions

  • How to size of ImageView using scaling property

    Hello

    I use Imageview to display images that are active, I want to resize them, I tried to use image resize using the scale in c ++. I am not able to do, how to do?

    Is it possible outside the scaling of method?

    Concerning

    Rakesh Shankar.P

    Quick and dirty example:

    ImageView * iv = new ImageView();
    iv->setImageSource(QUrl("asset:///fooo.png"));
    iv->setScalingMethod(ScalingMethod::AspectFill);
    iv->setPreferredSize(768, 1024);
    

    In practice, you'll want to load the image using ImageTracker, wait for the signal that it has loaded, and then set Image on imageview. ImageTracker you can also read the dimensions of the Image.

  • How to insert ScrollView

    But no letter or content that is not show me.

    I want that top screen touch down... Please help me...

    import bb.cascades 1.2
    
    Sheet {
        id: sheetSection
        property string myTitle
    
        Page {
            id: pageSection
    
            titleBar: TitleBar {
                title: qsTr("Acerca de")
                id: titleSection
    
                acceptAction: ActionItem {
                    title: "Cerrar"
                    onTriggered: {
                        sheetSection.close();
                    }
                }
            }
    
            Container {
                id: contSection
                Label {
                    text: qsTr("TiTanTenBerry")
                    horizontalAlignment: HorizontalAlignment.Center
                    textStyle.color: Color.DarkBlue
                    textStyle.fontWeight: FontWeight.W600
                    textStyle.base: SystemDefaults.TextStyles.BigText
                }
    
                ImageView {
                    imageSource: "asset:///images/info.png"
                    horizontalAlignment: HorizontalAlignment.Center
                }
                Label {
                    text: qsTr("Encontraras la mejor informacion")
                    horizontalAlignment: HorizontalAlignment.Center
                }
                Label {
                    text: qsTr("Aplicaciones, Juegos, Temas, Actualidad...")
                    horizontalAlignment: HorizontalAlignment.Center
                }
                Label {
                    text: qsTr("Todo sobre tu BlackBerry® \n Visita nuestro Blog "aqui la web")
                    horizontalAlignment: HorizontalAlignment.Center
                    multiline: true
                    textFit.mode: LabelTextFitMode.Default
                    textStyle.textAlign: TextAlign.Center
                }
    
            } //contSection
    
        } //pageSection
    
    } //sheetSection
    

    Not raise or lower... I want the screen to scroll up and down

    If you wish that the capacities of zooming and scrolling, you must use the ScrollView control.

    https://developer.BlackBerry.com/native/reference/Cascades/bb__cascades__scrollview.html

    Page{
     ScrollView {
       Container {
         //your ui elements
       }
     }
    }
    
  • Invalid scaling method

    We have extended ImageView in C++. It does us the method of scaling to none. We always get the message "invalid scaling method.

    Be if we set to None in C++ it is not working.

    setScalingMethod(ScalingMethod::None);
    

    Or if we have None in QML it does not work.

    scalingMethod: ScalingMethod.None
    

    All other scaling methods work very well.

    How do the ImageView is not on the scale of the image?

    The only solution that we see is to implement the ImageView in QML, that is not our preferred solution.

    Well, I found a really dirty solution.

    Suppose we have a QByteArray containing image data :

    setScalingMethod(ScalingMethod::AspectFit);
    QImage qImage = QImage::fromData(imageData);
    setPreferredWidth(qImage.width());
    setPreferredHeight(qImage.height());
    setMinWidth(qImage.width());
    setMinHeight(qImage.height());
    
  • Centering ImageView

    Hi all, how can we get a picture centered in the container? the code above is not centering my ImageView, is always on the left side...

    Any thoughtss? 0o0o

    Container
    {
    verticalAlignment: VerticalAlignment.Fill
    horizontalAlignment: HorizontalAlignment.Fill

    layout: {StackLayout}
    direction: LayoutOrientation.TopToBottom
    }
    ScrollView {}
    {Of container
    leftPadding: 20.0
    rightPadding: 20.0
    topPadding: 20.0
    bottomPadding: 20.0

    layout: {StackLayout}
    direction: LayoutOrientation.TopToBottom
    }

    ImageView {}
    verticalAlignment: VerticalAlignment.Center
    horizontalAlignment: P
    scalingMethod: ScalingMethod.AspectFit
    imageSource: "asset:///images/icon_big.png."
    }
    }
    }
    }

    It should work.  Add horizontalAlignment: P just below the {ScrollView

  • How ScrollView + gestureHandler (pinch) work together?

    I'm need ScrollView + gestureHandler (pinch) to large image scaling.

    If I use:

    Container {
        ScrollView {
            gestureHandlers: [
                PinchHandler {
                    // scaling code here
                }
            ]
        }
    }
    

    It does not together (ScrollView simply handle scroll events, but other gistureHandler do not work)

    I found the solution.

  • ScrollView do not scroll

    Hi all

    Anyone can point out what I'm doing wrong...

    ScrollView {
                            scrollViewProperties.scrollMode: ScrollMode.Vertical
                            scrollViewProperties.initialScalingMethod: ScalingMethod.Fill
                            layoutProperties: AbsoluteLayoutProperties {
                                positionY: 187.0
                            }
                            scrollViewProperties.overScrollEffectMode: OverScrollEffectMode.OnScroll
                            touchPropagationMode: TouchPropagationMode.Full
                            overlapTouchPolicy: OverlapTouchPolicy.Deny
                            Container {
                                Container {
                                    id: mContainer
                                    ImageView {
                                        imageSource: "asset:///images/m.png"
                                    }
                                }
                                Container {
                                    id: pContainer
                                    ImageView {
                                        imageSource: "asset:///images/p.png"
                                    }
                                }
                            }
                        }
    

    Thank you

    The problem is the tank this ScrollView contained in. Put a ScrollView within a DispositionAbsolue can cause the behavior you're seeing.

    If you can paste code that contains your code above, which may help us to help you.

  • ImageView Black question screen on DA - anomaly or something else?

    Hello friends,

    I'm developing an application of connected local transit. Part of it includes essentially maps for each bus line. I use nested within a ScrollPane ImageView. Many of the cards are superior to a dimension 768 and 1280.

    Question

    ScrollPane ImageView displays BLACK on some images, but not others. I can't understand why and how to fix it.

    My Application configuration

    1. Standard C + c++ / Cascades project
    2. Directory structure
      [Standard empty project template]
    3. + assets
      -main.qml
         

      import bb.cascades 1.0
      
      //-- create one page with a label and text
      
      Page {
          content: Container {
              layout: DockLayout {
              }
              background: Color.create("#FFFFFF")
              preferredWidth: 768
              preferredHeight: 1280
              ScrollView {
                  id: mapScroll
                  scrollViewProperties {
                      scrollMode: ScrollMode.Both
                  }
                  // This ImageView Appears Black on the DA - qml preview in IDE ok
                  /*ImageView {
                      id: m45ustock
                      preferredWidth: 2913
                      preferredHeight: 2283
                      imageSource: "asset:///images/m45ustock.png"
                      onTouch: {
                          mapScroll.scrollViewProperties.scrollMode = ScrollMode.Both
                      }
                  }
                  */
                  // THIS ImageView DISPLAYS CORRECTLY
                   ImageView {
                      id: m10town
                      preferredWidth: 1287
                      preferredHeight: 1631
                      imageSource: "asset:///images/m10townsend.png"
                      onTouch: {
                          mapScroll.scrollViewProperties.scrollMode = ScrollMode.Both
                      }
                  }
              }
          }
      }
      

      Create a folder "images" add attached images.

      - images
      -m10townsend.png
      -m45ustock.png

      Notes


      I commented the ImageView displaying BLACK. Toggle comments to test.

      Why is this happening?

      Ideas? Is this a bug? Are there restrictions on the ImageView in terms of file size, making it the dimensions, etc.?

      Thank you!

    Have you gotten nowhere on that?

    If you need to do a program, one way is to use http://supportforums.blackberry.com/t5/Cascades-Development-Knowledge/Using-QImage-and-QPainter-to-P...

    Was it the root cause of your problem?

    Stuart

  • Help me solve my problem with onTouch imageView acted before I have a chance to scroll the Please

    Hi, please help.
    I have a little imageviews in a scrollview. Notecard will sail me to another page, however, at the time wherever I touch the image, it takes me to the appropriate page with no chance to scroll down. How to scroll and then press the image to navigate. It seems that notecard is competing with scrollview and ontouch victories.

    How I've implemented to scroll my arranged vertically imigeviews and then when I find the question I want to, I touch it and it goes to the next page which is a separate qml file.

    scrolling workes fine when I commented the notecard section and ontouch fine work as well.

    I like:

    ImageView {}
    horizontalAlignment: P
    imageSource: "asset:///images/Sunshine.jpeg."
    preferredWidth: 700,0
    preferredHeight:200.0
    minWidth: 30.0
    minHeight: 30.0
    Notecard: {}
    page var getThirdPage() =;
    Console.Debug ("pushing retail" + page)
    navigationPane.push (page);
    }
    Property Page thirdPage
    function getThirdPage() {}
    If (! thirdPage) {}
    thirdPage = thirdPageDefinition.createObject ();
    }
    Return thirdPage;
    }
    attachedObjects:]
    {ComponentDefinition}
    ID: thirdPageDefinition
    Source: "thirdfilepage.qml".
    }
    ]
    }

    I have several of these points of view image, wraped in a single scrollview.

    I tried to find it through Google as well as the documentation of cascades with no luck. I'd appreciate any help, please

    Thank you
    Roland

    I'm glad that it worked without any problems!

    Please mark this resolved thread!

  • ImageView - cascades noob question

    Please bare with me, as I am new to QT & waterfalls and try to learn by hacking up a small application...

    The Dev Alpha is missing in a photo viewer, so it seemed an obvious candidate for a first application.

    I managed to read the file system and the list of all the images in the camera directory, however... I can't display images of big camera like an ImageView (small, no camera images/screenshots show correctly).  The debugger displays this error in the console:

    "ERR: Image ' / sdcard/DCIM/Camera/IMG_00000001.jpg' size of texture 1836 x 3264 exceeds application GL max 2048."

    It was created through:

    ImageView * image = ImageView::create("'/sdcard/DCIM/Camera/IMG_00000001.jpg").preferredSize(300,300);

    The 300 x 300 size favorite does not seem to help - I guess it's a scale after once the image is already copied into memory.  Is there a recommended method for pre scale the Image before passing in ImageView, or another method recommended to treat this type of situation?

    Thanks for your help.

    Hello

    There is a limit to the size of the images that can be processed by this call: 2048. For the images above it, you can do the following...

    Citing one of the experts:

    "

    You can download the image manually from the file to a QImage (http://qt-project.org/doc/qt-4.8/QImage.html), and then resize the image before asking the buffers of the pixel to set on the ImageView (https://bdsc.webapps.blackberry.com/cascades/reference/bb__cascades__ImageView.html).

    QImage previewImage; if(previewImage.load("filename")){     //Scale to fill the screen to allow peek preview     previewImage.scaled(size,Qt::KeepAspectRatio);     QByteArray previewImageByteArray((const char*)previewImage.bits(), imageSize); }
    

    "
    Feel free to ask for more information/help.

  • Scaling to external display

    I have a 2015 retina MacBook Pro with an external display k 4 (Asus PB287Q) and since the update for Sierra yesterday, I can select is more scaling "resolutions" which lie between 1920 x 1080 and 3840 x 2160. HD is far too big, far too small 4K. If you please, that there is a solution to this... I tried to restart, and it actually brought back the correct options until I closed the lid, and now they have disappeared and don't come back.

    That's what my display properties are similar (alt + click on Options):

    I had the same problem since the beta and still no word from apple. They completely borked seriously display drivers. I run dual monitors Dell P2715Q. A monitor allows me to choose the old scale with all the resolutions already supported 1080 p up to 4 k. 10.11 I could select the same resolutions on both monitors. Now I'm stuck with the resolutions that you mentioned on my second monitor. If I put my MBP to sleep and wake it up both monitors reflect the resolutions that show you without intermediate options between 1080 p and 4 k.

  • ImageView files

    Recent Utilitybill only gave imageview.spx as the ability to view my Bill. How can I handle this. ?

    In fact, when I search imageview.aspx it seems to be used for images (the meaning of the name), then you can try to rename it with an extension .jpg on the assumption that this is probably a JPEG image.

  • When the scaling in the layout, 1st page prints correctly, but the following pages were not properly/too large for the paper, parts of text missing scale

    When you try to print in Firefox and when the scale to the size of the page in the page layout, the first page prints correctly, but the following pages do not scale correctly and are too large for the paper, with the parts of the text are cut off at top and right. It is not fixed by checking or unchecking the scaling / shrink to fit page width "ignore" in the print window, or by changing the scale percent.

    I am running Firefox 15.0.1, on Mac OS 10.5.8.

    The same problem happens in preview print and if I save the copy in a .pdf file

    I tried all the fixes in the how to and others in various forums with no improvement.

    This happens everytime I try to print a document from scaling upwards or downwards in Firefox.

    I note the bug has been fixed and should in Firefox 21 right now, it will mean the use night http://nightly.mozilla.org/

  • Tecra A2 ACPI question - systems of scaling of the CPU do not work

    Hi *.

    I have Toshiba Tecra A2. It works very well for a year and a half, but now I have some problems. Apparently in ACPI problem. I use SuSE Linux (10.1), but I also have Windows XP Pro on this machine. In both CPU scaling systems do not work.

    Also, when I try to reboot both systems can stop, but then (I thing that it is the BIOS time) just shut down. I can only hold the power button for 5 seconds and material poweroff. I update the bios to version 1.4, set default values, but noting help.

    Any idea? And not only that, is possible to ask Toshiba support center any problem by mail or telephone?

    Thank you
    Branimir Ackovic

    Hi Branimir

    I'm don't know if someone will help you because Linux is not supported for operating system. Your device has two operating systems and also start Manager and there is no standard situation after discount and supported OS is there without any other substance.

    On this path, it is not easy to make a serious diagnosis, but you can try to contact the hotline of Toshiba. Please see the official page of Toshiba Europe under http://eu.computers.toshiba-europe.com

    I put t know in which country you live, but you can also try to contact authorized partner. Addresses you will find under http://www.csd.toshiba.com/cgi-bin/tais/su/su_gaspLocator.jsp?pf=true

    Good luck!

  • Lenovo Yoga Pro 2 scaling of questions

    For the preface, I made the common fixes. My text size is 250% and resolution is 3200 x 1600 and all. but when I try to do the things that involve flash applications, downloaded, etc., they are often incredibly small. For example, this is what happens when I try to play Knights of the old Republic 2 via steam:

    http://imgur.com/kOIfCdl

    I can't even run it in compatibility mode because it needs to start steam. Any ideas on how to solve this problem? Thank you.

    It is a small problem with higher res displays. You run Windows 10? Display scaling on Windows 10 is much improved compared to Windows 8/8.1.

    What you can do is to lower the 1080 p resolution and set the size of text to 100%. To do this, a 'Control Panel' on Windows Search search. Then click on 'hardware and sound '. Then click on "display". Then, pick up the left hand side, and you should find "adjust the resolution. Change this at 1920 x 1080, or what ever fits.

    Hope this helps

Maybe you are looking for

  • Update BIOS Portege 2010 / operating temperature

    Hello How can I update my BIOS when using Ubuntu Linux? The reason why I want to update my BIOS is on the one hand, Ubuntuwrites an error during the startup and recommend to upgrade andthe other hand, I fear that there may be a temperature problem, a

  • File, folder names are not displayed in my pictures folder

    Original title: file folder names Folder names are not displayed in my pictures folder

  • Save a Word Doc from desktop in Windows Works word processor

    Last week, the ability to save a document, Word of Windows works as an Office Word Document (doc) has disappeared from the choices in the Save as drop down in my Windows program, it works.  The only options that remain now are works (wks), Rich Text,

  • The installer WAP321 - HELP - HELP

    Hi all Our company located on 2 floor of a building of bussiness.  I just bought 6 WAP321 of Cisco devices and would like to set up a wireless network for users can move from 1 floor to the other floor with wireless always connect and speed is the fa

  • CODE 43 UNKNOWN ON THE COMPUTER DEVICE.

    Above is the screenshot of my device manager. As shown in answers.microsoft.com I tried to uninstall the devices on the host controller (unplug all usb devices), and then restart the computer, but problem not solved. I tried to install the Chipset dr