Zoom image - awt

Hi everybody,
i have created a buffered image in a Canvas, colored every pixel using nested-for loops
image.setRGB(x, y, color);
and then drawn by:
g.drawImage(image, x, y, w, h, null, this);.
For zooming, my first idea is to define zoom factor arccoding to mouse-pressed point and mouse-released point. Then using zoom factor to repaint, for example: drawing area = (0,0,100,100) and image size is (100,100)
if MP point at 25,25 and MR point at 75,75 i have
zoom = width / newWidth or heigh/newHeigh = 100 / (75-25) = 2
new w = 100*2 = 200;new h =100*2 = 200; new x = 25, new y =25;
then repaint().
It appears that the resulted image has been shifted, but not zoom like i expected. I would appriciate any suggestion.
Thanks

thanks for reply
okie i read through that
but where shall i add the scroll pane
i mean the code has so many panels
and should i extend the class with JScrollPane....
some src code wud be of great help
thanks in advance....

Similar Messages

  • 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

  • In ACR-9 an X appears in place of the zoomed image.

    I updated PS 2014 with ACR-9 and and from time to time an X appears in place of the zoomed image.  I have never had it before. How to fix it?

    A lot more information about your hardware and software is needed.
    BOILERPLATE TEXT:
    If you give complete and detailed information about your setup and the issue at hand,
    such as your platform (Mac or Win),
    exact versions of your OS, of Photoshop (not just "CC", but something like CC2014.v.2.2) and of Bridge,
    your settings in Photoshop > Preference > Performance
    the type of file you were working on,
    machine specs, such as total installed RAM, scratch file HDs, total available HD space, video card specs, including total VRAM installed,
    what troubleshooting steps you have taken so far,
    what error message(s) you receive,
    if having issues opening raw files also the exact camera make and model that generated them,
    if you're having printing issues, indicate the exact make and model of your printer, paper size, image dimensions in pixels (so many pixels wide by so many pixels high). if going through a RIP, specify that too.
    a screen shot of your settings or of the image could be very helpful too,
    etc.,
    someone may be able to help you (not necessarily this poster, who is not a Windows user).
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
    http://forums.adobe.com/thread/419981?tstart=0
    Thanks!

  • Zoom images dynamically

    Hi All,
               Can we zoom Images in ABAP? I have a requirement to use an image in my BSP application, and also the zoomed copy of it when certain events are fired in the same BSP application.since there are many images, i cant statically zoom every image and place it in repository.
    Please share your thoughts on this.
    Thanks,
    Vasuki

    Hi
    Hope there is no option of "Zoom images dynamically".
    But there is option to get the Dynamic Images.
    See
    Dynamic Images
    Regards,
    Sreeram

  • Writing a zoomed image

    I am using Vision for Visual Basic. I have a cwimaqviewer control that contains an image and is zoomed. When I write the image in the viewer control to a file, the resulting image in the file is not zoomed. I would like to write the zoomed image. Is this possible? If so, how? I am currently using the line below to write the image:
    Me.CWIMAQVision1.WriteImage Me.CWIMAQViewer1.Image, strImgFile, cwimaqFileJPEG, CWIMAQViewer1.Palette
    Thanks.

    bep -
    The zooming of an image is just for display purposes and doesn't modify the image, which is why it's not being written to file.
    To modify the image so that it appears zoomed in, use CWIMAQVision1.Resample2 with the desired height and width, and then write that image out to a file.
    Greg Stoll
    IMAQ R & D
    National Instruments
    Greg Stoll
    LabVIEW R&D

  • Changing the interpolation algorithm for zooming images

    Hi,
    i'm currently using Safari Version 4.0.1 (5530.18). Is there a way to disable the anti-aliasing for zooming images/changing it to a nearest-neighbor-algorithm to get crisp, non-blurred pixels? For inspecting pixel/game art (for which i use the zoom function mostly) the default behaviour it is pretty annoying.
    Thanks in advance,
    seb

    benlos wrote:
    > I am really new at this. I have about 30 images that I
    need to have uniform
    > backgrounds (just a solid color) and I'm not sure how to
    do that automatically.
    > Can I do it as a batch process? Any guidance greatly
    appreciated.
    > Ben
    There's no way to do it as a batch process.
    Linda Rathgeber [PVII] **Adobe Community Expert-Fireworks**
    http://www.projectseven.com
    Fireworks Newsgroup:
    news://forums.projectseven.com/fireworks/
    CSS Newsgroup: news://forums.projectseven.com/css/
    Design Aid Kits:
    http://www.webdevbiz.com/pwf/index.cfm

  • Zoom Image

    Hello!
    I loaded an image in the jPanel and I would like to zoom it. The following is the code I wrote, someone can help me to change the dimension of the displayed image?
    public class ImageClass
    extends Component
    //Propriet� pubbliche
    double g_sc;
    BufferedImage image;
    public void paint(Graphics g)
    Graphics2D l_g2 = (Graphics2D) g;
    AffineTransform l_at = null;
    l_g2.drawImage(image, l_at, null);
    Raster g_rast = null;
    void Load_actionPerformed(ActionEvent e) {
    image = new ImageClass();
    g_filename = txtfldImage.getText();
    g_image = JAI.create("fileload", g_filename);
    image.image = g_image.getAsBufferedImage();
    image.update(jScrollPane1.getGraphics());
    this.setCursor(Cursor.getDefaultCursor());
    g_rast = g_image.getData();
    Let me know. Thank you very much.
    Tommaso

    Do you just want to use java.awt.image package or are you open for using JAI?
    Here is a little code that I created for scaling an image. I used JAI.
    Hope it helps.
    ~sxm
    import java.awt.image.renderable.ParameterBlock;
    import javax.media.jai.*;
    import javax.swing.*;
    import com.sun.media.jai.widget.DisplayJAI;
    public class DisplayScaledImage extends JFrame{
         public static void main(String [] args){
              String fileName1 = "Compass.png";
              DisplayRenderableImage frame = new DisplayRenderableImage();
              frame.setTitle("Displaying Image...");
              //create an image
              RenderedOp img1 = JAI.create("fileload",fileName1);
              //scale it
              ParameterBlock params = new ParameterBlock();
              params.addSource(img1);
              params.add(2.0f);         // x scale factor
              params.add(2.0f);         // y scale factor
              params.add(0.0f);         // x translate
              params.add(0.0f);         // y translate
              params.add(Interpolation.getInstance(Interpolation.INTERP_BILINEAR));
              RenderedOp img2 = JAI.create("scale", params);
              //make it ready for displaying
              DisplayJAI panJAI = new DisplayJAI(img2);
              //add image to the pannel and the panel to the frame
              JPanel pan1 = new JPanel();
              pan1.add(panJAI);
              frame.add(pan1);
              frame.setSize(img2.getWidth(),img2.getHeight());
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setVisible(true);
    }

  • Jquery zoom plugin that shows images above the zoomed image on mouse rollover

    Hi all, after much effort and help from this forum I've managed to get a zoom effect to work on my image. It needed to be a loupe effect like this - http://www.dailycoding.com/Posts/imagelens__a_jquery_plugin_for_lens_effect_image_zooming. aspx
    This is the plugin I've used.
    Problem now is that I need images to appear above the image on mouse rollover. Currently - if I place images above this image and place my cursor over the image the zoom effect works but it ignores the images placed on top and just zooms in on the image shown below.
    I would be very appreciative of anyone who can help me with this issue.
    Thanks.
    I wondered if it was possible to stop the jquery zoom plugin working when I mouseover the image on top of the map. Maybe that would be a solution?

    > the image I have above the roll over I have just
    > inserted shows the image that should be shown when I
    roll over the image I
    > have
    > just inserted
    url address please. words will not work for this.
    random guess- check that the name and/or ID of every item on
    the page is
    unique.
    Alan
    Adobe Community Expert, dreamweaver
    http://www.adobe.com/communities/experts/

  • Is there a way to zoom images in and out without changing the frame?

    It is easy to move an image around within a frame without touching the frame, but I have not found a way to zoom in and out without touching the frame. I'm working with a lot of images (Indesign CS6 for PC) and I need to do this a lot. Thanks.

    I don't know what is the correct terminology, but none of those things does what I want.  With the Content Grabber I can move the image and see where it is going and place it where I want it, and the frame does not move and is not changed in any way. I want something that does exactly the same thing with "zooming" in and out on the image.
    Shift-drag on the corners moves the frame.  In the Transform panel, in the lower box, it makes the image AND the frame larger or smaller. Neither of these is what I want.
    If I'm not using the right terminology, let me try to explain.  If I have an image that is larger than the frame, then I can only see a small part of the image inside the frame.  If I could zoom out on the image, I would then see a larger part of the image in the frame, but the frame would be exactly the same size and in exactly the same place (just like it would be when you use the Content Grabber).  If I could zoom in on the image, then I would see less of the image but in more detail.
    If I could move (like the Content Grabber) AND zoom without doing anything with the frame, then I could get the image just the way I want it inside an already-properly-placed frame in the most straightforward and simple manner, and be able to see what I was doing in the process. Dragging on the corners is basically trial and error because you have to go through several steps before you see the final result.

  • Zoom image slider not working correctly

    I am using the {tag_largeimage,zoom,600,360} on http://meluka.worldsecuresystems.com/bedroom/bedside-cabinets/low-storage-on-castors. I want to either 1. make the slider work for the full width (600px) as at the moment the slider effect works for what looks like the deafault 150px width & then has no effect, or 2. Customize the slider width to 150px width (keeping the image at 600px wide). Does anyone know if this is possible with css/javascript & if so, can you please point me in the right direction?

    I just upgraded from the original iPhone 8Gb model to the iPhone 4 32Gb model. One of the first few days after I got the phone I had this problem and couldn't accept a call from my mother. A few days ago my wife tried to call me and the same thing happened. On the same day my wife tried to call, the unlock screen was black and the slider would not unlock the phone. I could pull the slider all the way to the right side of the screen, but it would just stay there and not wake the phone. Unfortunately, my wife's uncle was standing right next to me when this happened, and he just got the Droid X, and promptly took it out and unlocked it easily while mocking me. I never had this issue on my original iPhone, and it's kind of annoying, even though it doesn't happen very often, I hate having the question of "will I be able to answer my phone this time?" in the back of my mind. Reception is great, and I can hear people soooo much better than on my original iPhone, but this unlocking issue is the thing making me irritated. Especially when I'm right next to someone holding a brand new Droid X and showing me how easy it is to answer a call.

  • Delayed Fill command and intermittent scroll zooms image size

    Since the last CC update I've noticed that the first time I open the Fill command it takes a moment or two to appear. Thereafter during the same work session, the Fill command appears immediately when pressed, as it should.  I am not using it with an especially large open image file.  This has only occurred since the latest CC update.  What might cause the initial delay?
    The second thing I have seen is that the "Zoom with scroll wheel" command only zooms an open document intermittently.  It always works after I open Preferences and close them (without reselecting Zoom with scroll wheel - ie just opening and closing Preferences restores the function).  At other times it just stops working.
    Everything else seems to be working fine.  Anyone else observe these behaviours?  Any ideas on causes or solutions, please?  I have not tried resetting Preferences yet.
    I'm using a Logitech mouse with its latest driver.  Equipment is a 3770K cpu, Asus P8Z77-V Deluxe mothrboard, 32Gb ram, Asus GTX660 video card (with the latest drivers), (x4) SSD's for OS, Scratch and data files.  W7 64bit.  Photoshop CC.  System is stable.
    Thanks.

    For anyone who might come across this issue in the future - the answer to the laggardly Fill command start-up turned out to be the removal of some Topaz plugins.

  • Pan & Zoom image in Multistate object

    Hi Guys,
    I tried to create a multistate object with images that have a pan & zoom function, this works fine when I previewed this
    in the contentviewer on the desktop. But when I previewed it on my iPad de images won't show, however the scrollbars for the
    images are visible. Anybody an idea how to solve this problem?

    I solved it!
    You don't have to wait for the update of the iPad contenviewer!
    Check out this link:
    http://blogs.adobe.com/jlockman/2012/02/08/nested-overlay-solution-for-dps/

  • Saving a zoomed image in Elements 9

    I took a tiff picture of a forest (around 75 trees), upon zooming in I discovered one of the trees has a falcon's nest with a falcon feeding it's chicks, however, you could not see this detail without zooming in. I cropped the image to include only 5 trees with the nest tree in the middle, and zoomed in 300% to show the falcon & the nest; my question is: how do I save this tiff file at the zoom level that I chose? I want to share this file and would like this image to show the details as if it is at 100% and not need to zoom in to 300%? I am using Elements 9.
    Thanks

    This may not result in the best image quality, but you might try the following:
    1. Zoom your image to 300% and crop to taste.
    2. Go to Image>Resize>Image Size and enter 3 times the pixels on the longest side
        with check resample image, constrain proportions and Bicubic Smoother selected
        and click ok and see how the image looks at 100%.
    Example is 200 px on longest side
    After entering 3 times the longest pixel dimension
    MTSTUNER
    Message was edited by: MTSTUNER

  • How to cycle (ctrl-tab) among zoomed images without changing position?

    As I often do, I have several similar images open and zoomed in to a particular position.  But when I hit ctrl-tab to cycle among them, the view keeps getting moved to the upper-left corner of each image.  This defeats the ability to quickly compare the same part of each image.
    Is there any fix for this?  I seem to remember solving this in the past, but I can't recall how.
    (Using CS3, soon to upgrade to CS4, but need fix in CS3 as well.)
    Thanks!
    ~G
    [Edited: I originally wrote CS2, but meant CS3]

    The [https://addons.mozilla.org/en-us/firefox/addon/tab-mix-plus/ Tab Mix Plus] extension appears to have this feature, pictured in the screen shot here: http://tmp.garyr.net/help/#Events_-_New_Tabs

  • Navigating a zoomed image with shift+end... but using an action or a script?

    hello,
    i a have a crop script and with all my images i have to clean the floor...
    in that script the image goes to 200% zoom, them manually i hit "shift+end" to move to the bottom right of the image... so that i can clean that floor.
    can you help me automate the process with a script or lead me how to create the code?
    shift+end or shift+home using script
    thank you in advance
    Vitor Rompante

    Do you know how to code Photoshop Scripts in javascript.
    It is also impossible is Actions and  Script to give users complete manual control only interactive controls of a step is possible.    For complete manual control the script and actions need to be broken in to two actions or two scripts.  It can also be done by adding stops in actions that divide actions into part that can be used to continue execution after the stop and user operations.
    If its the just the bottom area you want to crop away its a relatively easy action to record. You would just inster a fit on screen menu item, record a select all,  then use menu select>Transform selection rotate the selection 180 and move up the bottom about 10 % commit the transform and finally record menu  image>crop. Stop recording the action and turn on the transform steps dialog to make the step interactive.  When the action is played the transform dialog bounding box will display and be interactive. You have control of the transform. If the recorded 10% bottom off is acceptable all you need do is hit enter to complete the crop.
    Try this one http://www.mouseprints.net/old/dpr/cropfloor.atn
    Crafting Actions Package UPDATED Aug 10, 2014 Added Conditional Action steps to Action Palette Tips.
    Contains
    Action Actions Palette Tips.txt
    Action Creation Guidelines.txt
    Action Dealing with Image Size.txt
    Action Enhanced via Scripted Photoshop Functions.txt
    CraftedActions.atn Sample Action set includes an example Watermarking action
    Sample Actions.txt Photoshop CraftedActions set saved as a text file.
    More then a dozen Scripts for use in actions
    Example
    Download

Maybe you are looking for

  • Error while opening the XML file

    Hi all, i'am trying to download data from internal table to XML file with root node and its corresponding child nodes.i have written the program in this way. tables: mara. include bcciixml_decl. include bcciixml_impl. parameters: p_matnr like mara-ma

  • OBIEE 11g Union Report Issue

    Hi all, Did one any of you started development work on 11g? If so have you created Union reports in 11g? I am facing two issues afte creating Union reports. 1.I am unable to sort the columns. (Report is automatically sorted according to alphabatical

  • Adobe 6 Standard with Reader 9

    I upgraded to  Adobe 9 Pro.  The challenge- we have 4 computers and it will only install on 2.  On the 2 it won't install on, we re-installed Adobe Acrobat 6 and also have on those 2 systems Adobe Reader 9.  Challenge- when we try to view anything in

  • Connecting a Palm TX to Airport Airtunes

    I am having a heck of a time getting my new palm tx to connect to my airtunes/airport. (WIFI connection) I am using WEP 2 encription and I can get the TX to see my network, but I won't accept the airport password. I have a few options of entering 10,

  • Converting .rpt file code into Perl code

    Hi All, I have some .rpt file which contains the following code to generate the report in Oracle .declare booking_no a13 .declare line_code a10 .declare line_booking a12 .declare book_date a11 .declare taken_by a10 .declare ud a10 .declare ship_name