Zoom In-Out Image

Hi all,
I want to apply the Zoom-In Zoom- Out feature on an Image .
Can anyone help me ?.....
Thanks

Are trying SEARCH here?
http://onesearch.sun.com/search/onesearch/index.jsp?qt=resize&subCat=siteforumid%3Ajava76%2Csiteforumid%3Ajava80%2Csiteforumid%3Ajava82&site=dev&dftab=siteforumid%3Ajava76%2Csiteforumid%3Ajava80%2Csiteforumid%3Ajava82&chooseCat=javaall&col=developer-forums
1) From SUN example
    private Image resize(Image image, int width, int height) {
        int sourceWidth = image.getWidth();
        int sourceHeight = image.getHeight();
        Image thumb = Image.createImage(width, height);
        Graphics g = thumb.getGraphics();
        for (int y = 0; y < height; y++) {
            for (int x = 0; x < width; x++) {
                g.setClip(x, y, 1, 1);
                int deltaX = x * sourceWidth / width;
                int deltaY = y * sourceHeight / height;
                g.drawImage(image, x - deltaX, y - deltaY, Graphics.LEFT | Graphics.TOP);
        Image immutableThumb = Image.createImage(thumb);
        return immutableThumb;
    }2: From this forum
private int[] reescalaArray(int[] ini, int x, int y, int x2, int y2) {
   int out[] = new int[x2*y2];
   for (int yy = 0;  yy < y2; yy++) {
     int dy = yy * y / y2;
     for (int xx = 0; xx < x2; xx++) {
       int dx = xx * x / x2;
       out[(x2*yy)+xx]=ini[(x*dy)+dx];         }       }
   return out;}
private Image getSmall(Image temp, int newX, int newY) throws Exception{
   //Need an array (for RGB, with the size of original image)
   int tX = temp.getWidth();
   int tY = temp.getHeight();
   int  rgb[] = new int[tX*tY];//Get the RGB array of image into  "rgb"
    temp.getRGB(rgb,0,tX,0,0,tX,tY);//Call to our function and obtain RGB2
    int rgb2[] = reescalaArray(rgb,tX,tY,newX,newY);//Create an image with that RGB array
    rgb = null;
    Image temp2 = Image.createRGBImage(rgb2,newX,newY,true);
    rgb2 = null;
    return temp2;
}

Similar Messages

  • 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.

  • How to (zoom in\out) on nokia e5 on images/photos

    how to (zoom in\out) on nokia e5 on images/photos ??
    I cant find zoom or any key to zoom any idea ??
    Solved!
    Go to Solution.

    Hello nour_esmat, did you try the volume buttons and the direction buttons? Try and reply.
    Nokia C7

  • E72 / Images - how to zoom in/out???

    Hi,
    Could not figure out how to zoom in/out when displaying an image in Media>Images... the usual */# do not seem to work here. And no clue in the provided help.
    Any ideas?
    Thanks!
    Rodolphe
    Solved!
    Go to Solution.

    Well done >

  • Zoom in/out into images

    Hi mates ,
    wanted to know if there is a method for zooming in/out to images or ill just have to implement it myself ?

    lshaibin,
    Use Graphics2D scale method in the paint method of your class that extends JPanel class.
    example:
    public void paint(Graphics g)
    Graphics2D g2 = (Graphics2D)g;
    // If you want some quality
    g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,RenderingHints.VALUE_INTERPOLATION_BICUBIC);
    g2.scale(zoom,zoom);
    g2.drawImage(image,0,0,null);
    g2.dispose();
    }

  • What script for Zoom in/ out of image?

    1. I plan to import quite bigger bitmap image and save as a
    Graphic Symbol
    2. Make some Botton Symbols for +(Zoom in, -(Zoom out) and
    Reset.
    3. If I click +(Zoom in) button, image (reduced sized image
    in smaller window) got magnified.
    ----> What scripts do I need for this design? I'm working
    on Flash8.
    Thanks much in advance!!
    *** I got this idea from the site of
    http://www.metmuseum.org/explore/cezannes_apples/look.html
    And click "Let's Look Closely"...

    First of all, dont put your image as a graphic symbol ... use
    movieClip instead.
    Lets say you transform it into a movieClip and give it the
    instance "image" and that your zoom button is called zoomBtn and
    the un-zoom button is called unZoomBtn:
    //--> start the loop for zooming in on "press" event
    zoomBtn.onPress = function(){
    this.onEnterFrame = zoomIn;
    //--> start the loop for zooming out on "press" event
    unZoomBtn.onPress = function(){
    this.onEnterFrame = zoomOut;
    //--> stop the loop for zooming in or out on "release"
    event of both buttons
    zoomBtn.onRelease = unZoomBtn.onRelease = function(){
    delete this.onEnterFrame;
    //--> line of code executed in loop for the zoom in
    function zoomIn(){
    image._xscale = image._yscale += 5;
    //--> line of code executed in loop for zoom out
    function zoomOut(){
    image._xscale = image._yscale -= 5;
    }

  • Flash Component: Image - crop, resize, rotate zoom in/out

    Hi, We've got a photo contest and we need an image
    manipulation tool that will allow users to import image, crop,
    move, resize, roate and zoom in/out to align their photo within a
    frame for example. Any one know of a component like this? I would
    appreciate and advice or links to other sites.
    Thanks in advance.
    Dan

    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.

  • Alt & scroll wheel not working on Photoshop CC to zoom in / out

    Hey! So i'm using the latest version of Photoshop CC, and i'm also running the Technical Preview of Windows 10. So In Photshop, usually when you hold the alt key and scroll with the scroll wheel on your mouse, it will zoom in / out of the image on Photoshop. Well i'm having some problems with that, it isn't working at all. In preferences I have it set to zoom with scroll wheel. Anyone know why it isn't working? Could it be something with the Windows 10 Preview?

    Please report Windows 10 issues to Microsoft, so they can get the information they need to fix the OS bugs before shipping the final version.

  • SX700 has a loud zoom in/out, which got picked up by the video. Is it normal?

    Hi All,
    I just received my Canon SX700 and went out for a test today. The picture quality wes good, the video image quality was great as well. I heard zooming in and out sound when I was shooting the video using SX700. After I came home and play it on my computer, the zooming in/out sound is indeed loud and clear. In addition, I heard clicking sound in some zooming in and out as well. Is it normal? Is it an one off defect? Should I return it? And comment/ suggestion/ advice is appreciated!
    Best regards,
    Sally

    The noise you can here is the zoom motor stopping and starting and very little you can do about it. The internal microphone is only doing it's job... picking ALL the sound up it detects.
    These cameras in the video mode is only a gimmick, the quality of these internal microphones leaves a lot to be desired, the only way round it is to use an external microphone, whether these cameras have that facility I can't say, do consult your user manual on using an external mic.
    Dave

  • 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]

  • 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.

  • Zoom in/out part of a picture

    Dear All,
    Could anyone please explain how to zoom in/out a particular part of a photo in AE? I had the tutorial once but I seem to have difficulty finding it. It had something to do with 'the anchor point'. It is a simple task with just a few steps but I cannot remember.
    Thank you very much.
    Palinkasocsi

    When you scale an image, it scales around the anchor point.
    This search pulls up a few tutorials about panning and zooming an image and using the anchor point to control the center of the zoom/scale.

  • Zoom in/out on panel -- efficient way?

    I need a panel to display an image, I want to be able to zoom in/out on that image, and have the panel resized (which would need to adjust the image being shown so that it fills the panel)....below is sort of what I was thinking...but is there a more efficient way?
    public void paint(Graphics g) {
         at =  new AffineTransform();
         int w = getParent().getWidth();
         int h = getParent().getHeight();
         int picW = pic.getWidth();
         int picH = pic.getHeight();
         double newW = ((double) w / (double) picW);
         double newH = ((double) h / (double) picH);
         at.scale(newW, newH);
         ((Graphics2D) g).drawImage(myImage, at, null);
    }Thanks

    1) Don't extent paint(), extend paintComponent()
    2) Keep a local copy of the image in your class. Use Image.getScaledImage()
    whenever the user changes the zoom level to modify your local copy. Have
    paintComponent reference the local copy.
    This way, you're only performing an expensive computation when the zoom
    actually changes, which is relatively infrequent, rather than every time you
    have to repaint, which is relatively often.

  • Zoom in/out in vision

    I'm using PCI1409 board and sony's CCD camera.
    I want to grab/snap every pixel of CCD, but show in half scale.
    (that means, CCD 640x480 pixel, buffer size is 640x480, but canvas size is 320x240)
    I want save the every pixel value and show half scale in the panel. (test software in MAX does it well)
    How can I make it?
    And tell me about the difference between picture and canvas control.

    Kaist,
    Are you using the new IMAQ Image Control that was introduced with LabVIEW 7.0 and IMAQ 2.6? With this Image Control you can zoom in/out of your image. Since this is only for the display, it will not affect your actual pixel values. Best of all, this is included in LabVIEW and you will not need Vision.
    If you need to use the picture control, you may have to create a new array and parse out every other row and column yourself.
    BB_Phil

  • Adobe illustrator CC Zoom in & out problem

    Hi,
    I am facing an issue right now..
    When i open a large AI file that above 1GB, then i zoom in & out .. the design will go out of form.
    However, when i open small file like 400+ MB, no issue on zoom in & out.
    I really no idea for this issue..
    Here is my PC spec,
    Windows 8.1 Professional
    3.40 gigahertz Intel Core i7
    32GB RAM
    NVIDIA GeForce GTX 650
    TQ.

    Moving this discussion to the Illustrator forum.
    Wandasgirl I would recommend reviewing your installation logs for errors.  Please see Troubleshoot install issues with log files | CC - http://helpx.adobe.com/creative-cloud/kb/troubleshoot-install-logs-cc.html for information on how to locate and interpret your installation log files.  You are welcome to post any errors you discover to this discussion.

Maybe you are looking for

  • How Can I do this - User Authenticate

    Hi, Is there a way to accomplish the following. We are using Citrix MetaframeXP, after the user logs onto the Citrix box, I don't want to have them enter there userid/password again to access my oracle jsp pages. (Website created with jsp from report

  • CR2 files won't open in Photoshop CS2

    I have a Canon Digital Rebel XT and my Photoshop CS2 software won't open these images. CR2 is listed in the Raw file format but selecting Raw doesn't open them. I have downloaded the latest Raw update. I am using windows. Can anyone help me??? Many t

  • Mac Book Pro  doesn't like my iTunes choices? HD Spinning out of sync

    Started my iTunes library and have been loading in over 100+ CD's. Now I have a very loud constand whirring sound, comming from the area just below the power button. If I put pressure on and around the power button compressing the whirring disc, the 

  • How do I watch livestream on iPad 4

    I'm trying to watch a sporting event on a local tv station but I am unable to do so on my iPad.  It works on laptop.  Is there an app I need to get for this?

  • Residual item

    Hi all,           i need to  write the code in user exit. but unable to identify the  tables and fields. Identify if the residual is being created as a result of the payment through Lockbox processing. If the residual is not being created through loc