Hi, I want  function ZOOM IN/OUT. everybody give share code please

thank you

Some image resizing code.. It consumes quite a lot of memory, so using it with big images will crash the phone.
shmoove

Similar Messages

  • Zoom in/out in the gesture area

    Hi,
    i want to zoom in into a movieclip.
    The zoom should zoom in the area where the gesture was taken.
    In this moment i scale the movieclip and set the new x and y coordinates by myself.
    This one works not as i wish.
    Any ideas?
    Best regards

    why didn't u use my tip?
    var contatiner = new Sprite();
    contatiner.x = bigBox.techChart.x + bigBox.techChart.width/2;
    contatiner.y = bigBox.techChart.y + bigBox.techChart.height/2;
    bigBox.techChart.x = -bigBox.techChart.width/2;
    bigBox.techChart.y = -bigBox.techChart.height/2;
    container.addchild(bigBox.techChart);
    Multitouch.inputMode = MultitouchInputMode.GESTURE;
    stage.addEventListener(TransformGestureEvent.GESTURE_ZOOM, fl_ZoomHandler_2);
    function fl_ZoomHandler_2(event:TransformGestureEvent):void
               if(container.scaleX*event.scaleX > .20 && container.scaleX*event.scaleX < 1)
                          trace("I'M ZOOMING OUT");
              container.scaleX *= event.scaleX;
              container.scaleY *= event.scaleY;
                          if(container.scaleX*event.scaleX > 0.9 && container.scaleX*event.scaleX < 1){
              trace("IM NORMAL AGAIN");

  • Zoom In/Out

    I'm trying to zoom in/out of a 3D room. At the moment, I've
    replicated this using a translate function:
    if gZoomIn then pCamera.translate(0,0,-1) --gZoomIn refers to
    the mousedown of a different sprite
    But I don't want to move the whole camera. Is the
    'FieldOfView' the best function to use? I can set this to a
    specific angle (like 90 below) but I can't seem to increment this
    by +/-1 on a mousedown
    if gZoomIn then pCamera.fieldofview =90
    Any ideas on how to script this?

    Yes, the 'zoom' feature of real-life cameras is the
    equivalent of the field of view of director 3d camera objects.
    Physically moving the camera forwards and backwards towards the
    target is actually called 'dollying' in real life.
    To narrow the field of view by one degree per frame, you
    could use something like this:
    if gZoomIn then pCamera.fieldofview =pCamera.fieldofview - 1
    You'll want to limit it to a minimum though, which can easily
    be achieved by using the 'max' command:
    if gZoomIn then pCamera.fieldofview
    =max(30,pCamera.fieldofview - 1)
    The above line will zoom in, but keep the field of view from
    going lower than 30 degrees. The matching 'zoom out' would look
    like this:
    if gZoomOut then pCamera.fieldofview
    =min(120,pCamera.fieldofview + 1)
    hope this helps!
    - Ben

  • Zoom In/Out Button with Pan AS3

    Good Day! I'm new to Flash AS3,
    And I have a major problem on my project
    What I've been doing is an Interactive map and some functions along with a zoom in/out and pan button
    I've got the code on the zoom in/out button, problem is when there is no limitation when I zoomed it in(Still researching this)
    Here is my code in the zoom in(I just change the + to - on the zoom out button ofc!)
         on(release){
         _root.SoilMap._xscale+=10;
         _root.SoilMap._yscale+=10;
    "I don't have any codes for the Pan Button yet"
    What my final output would be this, in the Black line square that would be my limit in the zoom in/out , and that is the area where
    I could only use my Pan button.
    Any codes that is related to this would help me.
    I've also research about the Javascript that can zoom/pan but it's only for JPG, i tried the SWF file but it didn't work.

    I am not really clear on what you are having a problem with nor how panning fits in with it.  If you want to place a limit on the zooming then use a conditional to check if the current scaling is at a maximum allowed value or not...
         on(release){
            if(_root.SoilMap._xscale < whatever_the_limit_is){     // could also use width (or height)
                 _root.SoilMap._xscale+=10;
                 _root.SoilMap._yscale+=10;

  • Acrobat pro 9 "save as" function is greyed out

    I can't save pdf 's in acrobat 9 pro
    save as function is greyed out
    happened all of a sudden
    is this a registration problem with master collection ?

    bman99 wrote:
    oh thanks for the quick reply. Then there's really no reason to save templates, there nothing without the apple templates.
    that's not really true. you can make an email yourself, add some images to it if you want and customize it to your liking. you can save that as stationery. you can also make an html document using your favorite html editor, open it in safari and do command+i. this will open it in Mail and you can save it as stationery from there. you just can't easily customize the premade templates right from Mail. you can do it using the links I gave you though.
    Brandon

  • Sometimes when panning with the hand tool, it zooms way out instead of just moving the canvas

    So normally when you hold the space key and drag, it just moves the canvas, but every now and then, seemingly randomly, it zooms way out and shows a little box which is the size and shape of the area of canvas I was previously looking at. If I move the box and let go of space, it zooms to that location, but all I wanted was to move normally. I don't think I've ever wanted the zoom out, move, then zoom back in behavior. What causes that? How do I make it stop?

    It's "bird's eye view" and by coincidence, your problem was discussed in another thread last night: Problem with zoom in Photoshop CS6

  • T510: TouchPad no longer allowing for zoom in/out

    My TouchPad is all the sudden no longer allowing for zoom in/out.  How do I restore that function. 
    Moderator Note: Edited subject to match content.

    My T520 has recently developed a similar problem.
    With no obvious warning it now seems unable to recognise the trackpad/point. I've tried various combinations of uninstalling/installing drivers etc with no success.
    When clicking on the mouse tab in Control Panel an error message says: Unable to connect to the Synaptics Pointing Device. It then suggests removing the synaptics driver and then reinstalling other mouse drivers. This doesn't make sense as I don't have any other mouse drivers installed (bar the in-built Win7 ones which can't be removed anyway). Then rebooting the system results in no pointing devices being available at all. The trackpad gets recognised as a PS2-compliant device and prompts installation of drivers (from synaptic) which just gets back to square one.
    Also, the control panel mouse tab won't show the ultranav utility even though that is installed properly.
    So, I'm having to use an external mouse as the system doesn't seem to be able to properly use the trackpad/point. I'll keep troubleshooting but suspect this may be a software/driver issue as it was working perfectly up until recently and the hardware can still "see" the device. Both are enabled in BIOS.
    Any other people experienced similar problems?
    T520 (4242-CTO) Win7 64Pro

  • ScrollPane zoom in/out

    Hello, this is my first post.
    I'd like to add zoom in/out function to my ScrollPane, and make shortcut (CTRL+MOUSE SCROLL UP/DOWN) for it. ( like Inkscape )
    I made the following code ( Canvas ) to achieve this, but have some problems.
    *1. How can I prevent ScrollBar's thumb to move when pressing CTRL?*
    When ScrollBar is visible and ScrollBar's thumb (or scroller, knob) has room to move, CTRL+MOUSE SCROLL UP/DOWN doesn't work because the thumb moves instead of zooming in/out.
    When the thumb moves up/down to bar's end, then zoom in/out finally works fine.
    *2. ScrollEvent handler is sometimes not called in ScrollPane*
    When ScrollBarPolicy is not ScrollBarPolicy.ALWAYS and Scrollbar is not visible, SOMETIMES CTRL+SCROLL UP/DOWN operation dosen't work.
    (ScrollEvent handler is not called. For other panes, ScrollEvent works fine. Please check MouseScrollEventTest below)
    Thank you in advance.
    Canvas
    public class Canvas extends Application {
         DoubleProperty zoom = new SimpleDoubleProperty(1.0);
         final double MAX_ZOOM = 3.0;
         final double MIN_ZOOM = 0.1;
         @Override
         public void start(Stage stage) throws Exception {
              Rectangle rectangle = RectangleBuilder.create()
                   .width(1000).height(1000)
                   .fill( LinearGradientBuilder.create()
                        .stops(new Stop(0, Color.BLUE), new Stop(1, Color.RED))
                        .build()
                   ).build();
              ScrollPane scrollPane = ScrollPaneBuilder.create()
                   .content(
                        GroupBuilder.create()
                             .children(rectangle)
                             .build())
    //               .hbarPolicy(ScrollBarPolicy.ALWAYS)
    //               .vbarPolicy(ScrollBarPolicy.ALWAYS)
                   .build();
              rectangle.scaleXProperty().bind(zoom);
              rectangle.scaleYProperty().bind(zoom);
              scrollPane.setOnScroll(new EventHandler<ScrollEvent>(){
                   public void handle(ScrollEvent event) {
                        if( !event.isControlDown() ) return ;
                        double zoomValue;
                        if ( event.getDeltaY() > 0 ) {
                             zoomValue = zoom.get() + 0.1;
                        } else {
                             zoomValue = zoom.get() - 0.1;
                        if( zoomValue > MAX_ZOOM || zoomValue < MIN_ZOOM ) return ;
                        zoom.set(zoomValue);
              Scene scene = SceneBuilder.create()
                        .width(500).height(500)
                        .root(scrollPane)
                        .build();
              stage.setScene(scene);
              stage.show();
         public static void main(String[] args) {
              launch(args);
    Mouse Scroll Event Test
    public class MouseScrollEventTest extends Application {
         BorderPane bPane;
         ScrollPane sPane;
         public void start(Stage stage) throws Exception {
              EventHandler<ScrollEvent> handler = new EventHandler<ScrollEvent>() {
                   public void handle(ScrollEvent event) {
                        System.out.println(event);
              bPane = new BorderPane();
              bPane.setPrefSize(100, 100);
              sPane = new ScrollPane();
              sPane.setPrefSize(100, 100);
    //          sPane.setContent( new Rectangle(50,50) );
    //             This works fine.
              bPane.setOnScroll(handler);
    //             Sometimes, this is not called.
              sPane.setOnScroll(handler);
              HBox root = new HBox();
              root.getChildren().addAll(bPane, sPane);
              Scene scene = new Scene(root);
    //          scene.setOnScroll(handler);
              stage.setScene(scene);
              stage.show();
         public static void main(String[] args) {
              launch(args);
    }--- My Environment
    Windows Vista
    JavaFX 2.0 SDK
    Edited by: 932474 on 2012/05/07 4:31
    Edited by: 932474 on 2012/05/07 4:47

    Thank you for the good example.
    But actually, I just give up using ScrollPane and created a ZoomCanvas which can zoom in/out and pan.
    The code is here.
    Any comments or improvement would be appreciated.
    ZoomCanvas
    public class ZoomCanvas extends StackPane {
         private ZoomController zoomController;
         private Group contentWrapper;
         private double translateXWhenMousePressed, translateYWhenMousePressed;
         private double xWhenMousePressed , yWhenMousePressed;
         private static class ZoomController {
              private int deltaCount = 0;
              private final double DEFAULT_ZOOM = 1.0;
              private boolean useAnimation = true;
              private DoubleProperty zoomMax   = new SimpleDoubleProperty(10.0);
              private DoubleProperty zoomMin   = new SimpleDoubleProperty(0.1);
              private DoubleProperty zoomDelta = new SimpleDoubleProperty(1.2);
              private DoubleProperty zoom      = new SimpleDoubleProperty( DEFAULT_ZOOM );
              public ZoomController() {
              public void zoomIn() {
                   double zoomValue = DEFAULT_ZOOM * Math.pow(zoomDelta.get(), deltaCount+1);
                   if( zoomValue > zoomMax.get() ) {
                        setZoom(zoomMax.get());
                        return;
                   deltaCount++;
                   setZoom( zoomValue );
              public void zoomOut() {
                   double zoomValue = DEFAULT_ZOOM * Math.pow(zoomDelta.get(), deltaCount-1);
                   if( zoomValue < zoomMin.get() ) {
                        setZoom(zoomMin.get());
                        return;
                   deltaCount--;
                   setZoom( zoomValue );
              public void setZoom( double zoomValue ) {
                   if( useAnimation ) {
                        Timeline zoomTimeline = new Timeline();
                        zoomTimeline.getKeyFrames().add(
                             new KeyFrame(Duration.millis(300), new KeyValue(zoom, zoomValue))
                        zoomTimeline.play();
                   } else {
                        zoom.set(zoomValue);
         public ZoomCanvas(Node content) {
              super();
              Rectangle clip = new Rectangle();
              clip.widthProperty().bind(widthProperty());
              clip.heightProperty().bind(heightProperty());
              // to adjust layoutBounds when drawingPane's scale changes
              contentWrapper = new Group(content);          
              StackPane.setAlignment(contentWrapper, Pos.CENTER);
              getChildren().add(contentWrapper);
              zoomController = new ZoomController();
              content.scaleXProperty().bind(zoomController.zoom);
              content.scaleYProperty().bind(zoomController.zoom);
              content.translateXProperty();
              hookEvents();
              setClip(clip);
         private void hookEvents() {
              setOnScroll(new EventHandler<ScrollEvent>() {
                   public void handle(ScrollEvent event) {
                        if( event.getDeltaY() > 0 ) {
                             zoomController.zoomIn();
                        } else {
                             zoomController.zoomOut();
              setOnMousePressed(new EventHandler<MouseEvent>(){
                   public void handle(MouseEvent event) {
                        if( !event.isMiddleButtonDown() ) return ;
                        translateXWhenMousePressed = contentWrapper.getTranslateX();
                        translateYWhenMousePressed = contentWrapper.getTranslateY();
                        xWhenMousePressed = event.getX();
                        yWhenMousePressed = event.getY();
                        setCursor(Cursor.MOVE);
                        event.consume();
              setOnMouseReleased(new EventHandler<MouseEvent>(){
                   public void handle(MouseEvent event) {
                        setCursor(Cursor.DEFAULT);
              setOnMouseDragged(new EventHandler<MouseEvent>(){
                   public void handle(MouseEvent event) {
                        if(!event.isMiddleButtonDown())
                             return;
                        contentWrapper.setTranslateX( translateXWhenMousePressed +  event.getX() - xWhenMousePressed );
                        contentWrapper.setTranslateY( translateYWhenMousePressed +  event.getY() - yWhenMousePressed );
                        event.consume();
    ZoomCanvasTest
    public class ZoomCanvasTest extends Application {
         public void start(Stage primaryStage) throws Exception {
              Rectangle rect = new Rectangle(0,0,100,100);
              rect.setStyle("-fx-fill: blue;");
              Circle circle = new Circle(100,100,50);
              circle.setStyle("-fx-fill: red;");
              Pane canvasContent = new Pane();
              canvasContent.setStyle(
                        "-fx-background-color: papayawhip;" +
                        "-fx-border-color: black;");
              canvasContent.getChildren().add(circle);
              canvasContent.getChildren().add(rect);
              ZoomCanvas canvas = new ZoomCanvas(canvasContent);
              canvas.setStyle(
                   "-fx-background-color: mistyrose;" +
                   "-fx-border-color: black;"
              ToolBar toolBar = new ToolBar();
              toolBar.setOrientation(Orientation.VERTICAL);
              toolBar.getItems().add( new Button("sample") );
              BorderPane root = new BorderPane();
              root.setCenter(canvas);
              root.setRight(toolBar);
    //          root.getChildren().addAll(canvas, toolBar);
              Scene scene = new Scene(root);
              primaryStage.setScene(scene);
              primaryStage.show();
         public static void main(String[] args) {
              launch(args);
    }Edited by: 932474 on 2012/05/08 10:17
    Edited by: 932474 on 2012/05/08 10:40
    Edited by: 932474 on 2012/05/08 10:56

  • After zoom in/out to open callout is wrong position

    Dear All
    After zoom in/out screen , i open callout.
    I'm having problems with its position
    code:
        <fx:Declarations>   
              <s:Callout   id="bCallout"
                      mouseDownOutside="bCallout.close()"
                      mouseUp="bCallout.close()"
                      backgroundColor="0x999999"
                      contentBackgroundAlpha="0"/>
       </fx:Declarations>
      <fx:Script>
         private function zoom_action(act:String):void {
                   var z:Number;
                    if(act=='+'){
                          z=0.25;
                    }else{
                           z=-0.25;
                    var my_matrix:Matrix = new Matrix();
                    my_matrix.scale(gr1.scaleX+z, gr1.scaleX+z);
                    gr1.transform.matrix=my_matrix;
       </fx:Script>
      <s:Group id="gr1">
              <s:Button id="btn1"  x="24" y="50" label="btnA" click="bCallout.open(btn1)"/>
              <s:Button id="btn2"  x="100" y="100" label="btnB" click="bCallout.open(btn2)"/>
               <s:Button id="btn3"  x="170" y="150" label="btnC" click="bCallout.open(btn3)"/>
      </s:Group>
      <s:Button id="zoomin" y="10" right="108" width="44" height="42" label="+" alpha="0.5"
                                    click="zoom_action('+')"/>
      <s:Button id="zoomout" y="10" right="59" width="44" height="42" label="-" alpha="0.5"
                                    click="zoom_action('-')"/>
    Any ideas what I'm doing wrong?

    You need a Mac user to come along and give you better advice, but meanwhile, Goggle
    photoshop cc lag yosemite
    You are _not_ alone.

  • I want to zoom into digital image pixels.

    To demonstrate DSLR chip behavior at high magnification, I want to zoom into the frame and see how individual pixels actually look.
    But when I use the Scale tool to enlarge the picture, FCPX thinks I want to avoid seeing pixels so it mushes the image, blurring all the pixels.
    How do I get it to stop doing that? Can it be done in Motion?
    Photoshop scaling has all these Bicubic options, but it also has the Nearest Neighbor option so I can see individual pixels in the blow up, there. Is there a way to get FCPX to do the same idea?

    Peter Inova1 wrote:
    When you are zooming into a movie that is made in a way to reveal an HDSLR's blown pixels, it would be nice to see them as a pixel map.
    again: the actual compression (from any cam!) doesn't deliver single pixels.
    it starts on the sensor of the cam - ever heard of the Bayer Filter?
    http://en.wikipedia.org/wiki/Bayer_filter
    if you could read out the raw data of that chip, you'd notice twice as much green 'dots' than red and blue, oops!
    next, your cam compresses '4:2:0'
    http://en.wikipedia.org/wiki/4:2:0
    that Chroma Subsampling drops 7 of every 8 'color dots' ... most pixels are 'grey'!
    finally, it's a lossy codec, working with 'assumptions'
    http://en.wikipedia.org/wiki/Inter_frame
    picture-prediction .... that's bits, not atoms
    on de-coding, final delivery, these 'formulas' are calculated to a 1920x1080 picture ... but that is not the 'pixel reality' from your cam, nor on its sensor, nor in the file.
    so, a zoom-to-pixel-level is a special effect, as mentioned above, create a close-up in Photoshop, showing r/g/b- squares … but this is not reality.

  • How to Provide Zoom-in/out Facility in SmartForms Report?

    hi all,
    can someone tell me how to provide Zoom-in/out facility in a smartforms report? We have a report with very small font and we hardly read contents in preview screen. can someone provide some help on this?
    thanks in advance,
    sid

    This will take in your spool request and download a PDF file to your PC where you can view it in Acrobat:
    REPORT zpdf MESSAGE-ID zc LINE-SIZE 255 NO STANDARD PAGE HEADING.
    PARAMETERS: spoolid LIKE tsp01-rqident OBLIGATORY.
    DATA BEGIN OF pdf_table OCCURS 0.
            INCLUDE STRUCTURE tline.
    DATA END   OF pdf_table.
    DATA pdf_fsize TYPE i.
    CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
         EXPORTING
              src_spoolid   = spoolid
              no_dialog     = 'X'
         IMPORTING
              pdf_bytecount = pdf_fsize
         TABLES
              pdf           = pdf_table
         EXCEPTIONS
              OTHERS        = 0.
    CALL FUNCTION 'DOWNLOAD'
         EXPORTING
              bin_filesize = pdf_fsize
              filetype     = 'BIN'
         TABLES
              data_tab     = pdf_table.
    Rob

  • Zoom in/out for CLDC

    Hi all,
    Can you help with a zoom in/out function? I've seen several methods with area filtering for Java SE but they don't seem to be the best for mobile devices. In the oder side i have a function with two joined loops in both image-dimension which extends/reduces each pixel. The performance is not so good and proccessing time ist too long for large images.
    Thanks in advance,
    Gonzalo

    [check out this|http://www.java-tips.org/java-me-tips/midp/how-to-implement-zoom-in-and-zoom-out.html]

  • How to zoom in/out AND resize image?

    sorry if they are stupid questions but i can't seem to find how to resize and image and zoom in/out. I am using Version 3 of Photoshop Album Starter Edition.
    thanks in advance.

    Don't know what you want to do...
    Resize the actual image file? If so, PSA SE can't really do that.
    Just look at an image at different magnifications? Select image, F11 for full screen, then use CTRL/+ and CTRL/- to adjust.

  • Zoom in/out gesture UIView

    Hi, i've been trying to capture gesture zoom in/out in a UIView.
    Code:
    UITouch *first = [twoTouches objectAtIndex:0];
    UITouch *second = [twoTouches objectAtIndex:1];
    CGPoint firstPoint = [first locationInView:self];
    CGPoint secondPoint = [second locationInView:self];
    CGFloat initialDistance = distanceBetweenPoints(firstPoint, secondPoint);
    I'm using the function distanceBetweenPoints, the problem is that firstPoint or secondPoint always is 0.00, 0.00 and for that reason the result is the value of one of them.
    I need that the booth values should be distint to zero for obtain the real distance.
    The frame of the view is: (0, 0, 320, 417).
    The functionality that i'm developing is something like zoom in/out of google maps.
    Thanks,

    Correction:
    NSSet *allTouches = [event allTouches];
    NSArray *twoTouches = [allTouches allObjects];
    UITouch *first = [twoTouches objectAtIndex:0];
    UITouch *second = [twoTouches objectAtIndex:1];
    CGPoint firstPoint = [first locationInView:self];
    CGPoint secondPoint = [second locationInView:self];

  • Zoom In/Out Funda

    Hi Everybody !
    I am just new this forum.
    I am working on a project which creates some drawing on the JPanel using Polygon class and now what I need is to zoom In and Zoom Out that Image. I have made that concept of zoom In and Zoom Out by Scaling Concept. It works but it also actutally creating a problem.
    The Problem : We have large width as compare to height of that polygons that we are drawing on the JPanel. Polygon use to have DataStructure in Integer format and here when we try to either zoom In/Out the by scaling, as width is much large as comapre to height so sidth reduces/increasines perfectly as the neglecting factor that is the data comes after decimal doesn't put much affect over it. However when we consider the case of height, the neglection of data after decimals put much affect in increasing/decreasing the height. So it doesn'tr look nice after certain zoom IN/OUT operations.
    The second problem that I am facing is that as we zoom out a certain number of times, few polygons lost out as their height tends to decreased below than one and then never regenerate itself on performing Zoom IN operations.
    Does anybody help me out in this matter.
    Thanks for your reading and consideration.

    What context in the Finder would you expect zoom to work?  same question for rotate?
    I am able to see rotate and zoom working in iPhoto and Preview.  I do not have Aperture so I cannot check.

Maybe you are looking for

  • HP's Low Quality Product and Customer Service

    On 1/23/15 I ordered a brand new Envy Phoenix 810 with modifications. First the website was broken and I ended up having to call to get the order placed. The computer arrived on 1/30/15 via FedEx, since paid for 2 day delivery. The computer ran for 7

  • ACE - HTTPS CLASS MAP CONFIGURATION

    Hi, We have a secured web site (HTTPS) currently fronted by Cisco ACE 4170, running version A5(1.2). We are trying to use the http class map to manipulate the traffic flow in the following manner: https://abc.com/ABC/* -> serverfarm#1 https://abc.com

  • Poor Quality in Wide-Screen When Exporting HD to Quicktime

    Hello all... I'm working on a fairly large project in iMovie HD with wide-screen footage from my Sony HDR-HC3 and have hit a wall. I can't seem to get a good result when I export clips into Quicktime in a wide-screen format. They are a bit choppy & y

  • Error when adding multiple source data stores in ODI Interface

    I am trying to create an ODI Interface with couple of source tables and one target table. Say for example I am using the following data structure in my target table. Order (Target Table) order id product id customer id address id warehouse id shipmen

  • Licensing for this product has stopped working CS3

    i had to replace my hard drive and re-install CS3 and now get the warning "Licensing for this product has stopped working" frustrated