Problem in getting the image coordinates  when i zoom in or zoom out

Hi,
i have doubts with scaling (Zoom in and Zoom out) using following code but when i zoom in want to get the x and y coordinates but im getting resized coordinates , pls do the needful
public class TiffTest extends JFrame implements MouseListener
public TiffTest(String filename)
RenderedImage source= JAI.create("fileload",filename);
SubsampleBinaryToGrayDescriptor sb=new SubsampleBinaryToGrayDescriptor();
RenderingHints rh=new RenderingHints(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_DEFAULT);
RenderedOp op=sb.create(source,new Float(0.5),new Float(0.5),rh);
JScrollPane scrollPane = new JScrollPane();
displayjai dj=new displayjai(op);
scrollPane.setViewportView(dj);
getContentPane().add(scrollPane,BorderLayout.CENTER);
int screen_width=(int)this.getToolkit().getScreenSize().getWidth();
int screen_height=(int)this.getToolkit().getScreenSize().getHeight();
setVisible(true);
setSize(screen_width,screen_height);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setExtendedState(JFrame.MAXIMIZED_BOTH);
dj.addMouseListener(this);
JAI.create("filestore",dj.ima,"god.tif","TIFF");
public static void main(String s[])
new TiffTest("1_org.tif");
public void mouseClicked(MouseEvent e){System.out.println(e.getX()+","+e.getY());}
public void mousePressed(MouseEvent e){}
public void mouseReleased(MouseEvent e){}
public void mouseEntered(MouseEvent e){}
public void mouseExited(MouseEvent e){}
class displayjai extends DisplayJAI
RenderedOp ima;
public displayjai(RenderedOp inputImage)
super(inputImage);
ima=inputImage;
setPreferredSize(new Dimension(ima.getWidth(),ima.getHeight()));
System.out.println(inputImage.getWidth()+","+inputImage.getHeight());
Thankx
Kannan

hi all,
I am getting the image from the server.but the problem is i am getting the Exception as ArrayOutOfBound exception.
It was displaying the Image for the first time.and when ever it was going for the second time in to the paint method it was displaying the IOException in reading the stream from the connection.
can anybody give me the solution in rectifying that exception.
thanks in advance
lakshman

Similar Messages

  • Problem in getting the image through URL

    hi all,
    I facing the problem,Inwhich i am unable find the solution...I am using the following code to display the image
    public void doGet(HttpServletRequest request,HttpServletResponse response)
                        throws IOException, ServletException {
                   int data=0;
                   response.setContentType("image/png");
                   ServletOutputStream out = response.getOutputStream();
                   String file = request.getContextPath()+imageNames[0];
                   //String file = "C:/Program Files/Apache Group/Tomcat 4.1/webapps/ImageComm/WEB-INF/images"+imageNames[index];
                   BufferedInputStream in = new BufferedInputStream(new FileInputStream(file));
                   System.out.println("the size of the inputStream is..."+in.available());
                   System.out.println("the context path is..."+request.getContextPath());          
                   while ((data = in.read()) != -1) {
                   out.write(data);
    with the above i am not getting any error at the compile time but it was giving exception like FileNotFoundException.
    but the same thing(URL address) when i am copying on the browser it was displayig the image.
    (what might be the reason)
    one more thing when i commented on the url address and try to use the actual realpath address it was displaying the image with out any problem
    can anybody give me the solution like where to keep my images by which i can able to get the images through url address
    thanks in advance
    lakshman

    hi all,
    I am getting the image from the server.but the problem is i am getting the Exception as ArrayOutOfBound exception.
    It was displaying the Image for the first time.and when ever it was going for the second time in to the paint method it was displaying the IOException in reading the stream from the connection.
    can anybody give me the solution in rectifying that exception.
    thanks in advance
    lakshman

  • SmartView Problem: I get the following error when submitting from Excel

    Table already exists. <BR>Unspecified error
    <BR>Table already exists.
    This Upload File worked before. I have checked the Function and it looks fine.
    I can "Refresh" but as soon as I "Submit" I get this error
    Edited by: user6378062 on 2009/01/20 10:42 PM

    Good morning,
    Please, open a TAC service request to have this investigated further.
    When you do, please, attach the exact steps you follow to get this error, as well as a sysreport from the Show and Share appliance.
    Also, it would be good to confirm whether other users are also seeing the same error or not.
    Regards
    Daniel

  • I am trying to create a button in flash that will display 4 separate images at the same time when clicked.  I can't get the images to stay on when I take the mouse of the button.  I need the actions script code to make this happen.

    I am trying to create a button in flash that will allow the user to click on the button and 4 separate images show up at the same time.  I can get the images to appear when I click the button but they will not stay on the screen.  I need to know what code I use to make the images stay once the button is clicked, then I need to know exactly where I place that code.  It does not appear to be possible to add the action code to the buttons layer since each time I add a new layer I just get another "up" "over" "down" and "hit" line.
    Thank you in advance
    AP

    It is not clear how you are trying to realize this from your description.  If you are trying to create this within a button symbol it will not work.  Explain your approach and if there is code involved, show what you have so far.

  • Problem updating to iphoto 9.6 after upgrading to Yoesmite  I am getting the following message when I try top date iPhoto This update is not available for this Apple ID either because it was bought by a different user or the item was refunded or canc

    problem updating to iphoto 9.6 after upgrading to Yoesmite  I am getting the following message when I try top date iPhoto This update is not available for this Apple ID either because it was bought by a different user or the item was refunded or canc

    "This update is not available for this Apple ID either because it was bought by a different user or the item was refunded or cancelled." ?
    This error message will appear erraneously, if you skipped the update to Mavericks and iPhoto 9.5.1 and went straight from an earlier MacOS X version to Yosemite, without first updating to iPhoto 9.5.1 and associating iPhoto to your AppleID.
    Try first to buy iPhoto with your AppleID instead of updating. Delete iPhoto from Applications, but don't empty the Trash, then go to the main page of the App Store and search for iPhoto. If you are lucky, it will show as free and you can buy it directly.
    If iPhoto  is not showing as free, there is no help but contacting the App Store Support: Ask for a redemption code. You will need to provide a prove of purchase for your mac with iPhoto preinstalled.
    http://www.apple.com/support/mac/app-store/contact/

  • Is it possible to get the image from the i pad when mirroring via Apple TV to fill the screen instead of appearing as a screen within a screen?

    When mirroring, is it possible to get the image from the ipad to fill the screen on the TV instead of appearing as a screen within a screen?

    Welcome to the Apple Community.
    No, the iPad has an aspect ratio of 4:3, a TV has an aspect ratio of 16:9, to fit one into the other is impossible without distorting the picture. If your TV has a zoom feature, you may be able to use this to fill the screen a little more to your liking, but this will result in cropping top and bottom.

  • When editing an image in Photoshop from Lightroom then saving it back to Lightroom, how do i get the image to go back and  sit next to the original? Mine is going to the end of the folder. Thanks Karen

    When editing an image in Photoshop from Lightroom then saving it back to Lightroom, how do i get the image to go back and sit next to the original image? Mine is going back to the end of the folder. Thanks Karen

    Hi Karen
    You may the sort set to Custom. Click the dropdown menu on the toolbar (to the right of the word sort) and change to capture time.
    If you can’t see the toolbar above the filmstrip press the T key. Press T again to hide.

  • When I open a HTML document in Safari all the images change to a ?  How do i stop this and get the images back?

    When I open a HTML document in Safari rather then getting an image, I get a ? in a box.  Why is this and how can I change it to get the images back?

    monkeyde,
    You are getting entagled in the two confusing meanings of the term pixels, namely as a unit identical to points and equalling 1/72 inch, and the basic component of raster images (and effects).
    You can read on in this very recent thread:
    Is there a way to get Illustrator to know how many pixels are in an inch?

  • Please help, i used to have various colors to select from when selecting FILL in Keynote such as red, now I only have a few pastel colors. I cannot seem to fix this problem to get the original colors back. Can someone please advise what I need to do.

    Please help, i used to have various colors to select from when selecting FILL in Keynote such as red, now I only have a few pastel colors. I cannot seem to fix this problem to get the original colors back. Can someone please advise what I need to do.

    i have on my ipad2 and re-download it - but I can't afford to loose the presentation that I currently have ....??
    Are you using Keynote on an iPad?
    If so you posted in the wrong forum, this is the Keynote Mac discussion and it is a different application. I dont know how the iPad works at all, so I cant help you, post in the Keynote iOS discussion.
    If you are using a Mac, the colours palette is accesed by clicking on the colour well (arrowed) and then selecting a colour chip or changing the color in the colour wheel.

  • When I connect my Air to my Samsung TV, I am able to see the screen mirrored on the tv for a split second before the tv turns to static.  This pattern then cycles over and over.  I can't get the image to stay on the tv screen.  Any ideas?

    When I connect my Air to my Samsung TV, I am able to see the screen mirrored on the tv for a split second before the tv turns to static.  This pattern then cycles over and over.  I can't get the image to stay on the tv screen.  Any ideas?

    Try:
    - Going to NF support site/contacting them
    - Try a different adopter
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings      
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                 
    iOS: How to back up                             
    - Restore to factory settings/new iOS device.

  • Can't get itunes.  I get the following message when I click on either the shortcut or the program.  It says ITunes has stopped working and I can either check on line for a solution and close the program or just close the program.

    When I click on the itunes shortcut or the program  I get the following message:
    ITunes has stopped working.  My two options are:  Windows can check on line for a solution to the problem or close the program. 
    It seems that my entire library is not there.  If I sync my ipod will it add it back into my library on the computer? 
    I've even tried installing again and nothing works.  Tried the "repair" and it says that ITunes is loaded but I stil get the above error when I try to open the program.
    Thanks

    Let's try the following user tip with that one:
    iTunes for Windows 10.7.0.21: "iTunes has stopped working" error messages when playing videos, video podcasts, movies and TV shows

  • I have a macbook pro, a mini display port to hdmi cable to hook up to my tv (a toshiba 1080p flatscreen).  what do I do to actually get the image on the tv screen?  Do I need another cable for sound?

    I am trying to watch a tv show that I purchased into I-tunes.  I have the cable and it hooks to the TV okay.  The TV shows the regular apple screen that looks like the universe screen - like when it boots up or is doing an upgrade on the OS.  I can't get the image to go from the laptop to the TV.  I tried under displays and it shows the TV as a display but I can't get the image on the TV.......Please help.

    Rwogera wrote:
    I couldn't transmit sound either, do i need another cable like Kim said? i mean it cant be transmitted through this HDMI port? as for me i have one of the latest mac pro with intel core i5..tnx
    I need to know which MacBook Pro you have.  Only mid-2010  and later MBP's transmit sound through MiniDisplay Port to HDMI.  I have no information about the Mac Pro, so you might want to go to that Forum and ask there.

  • After closing out, FF will not restart, says it is already running forcing me to reboot. I have removed and re-installed FF and still get the same message when trying to open the internet using FF. How can this be fixed?

    When I close out Firefox, and return later to use the internet, I click on Firefox and it gives me a message stating that Firefox is already running and needs to be closed before restarting or reboot my system. This occurs every time Firefox is closed and attempt to re-start it,,, not only at times,,,, EVERY time.
    I have tried removing Firefox from my system and re-installing to fix this issue however,,, this did not work. After re-installing, I still get the same message when attempting to restart Firefox.
    I have also tried Ctrl, Alt, delete to open the task manager and find there is no task to close.
    I do not have any problems when using IE, I prefer to use Firefox as it is faster and crashes less than IE.
    I am very frustrated at having to reboot my system each time I want to use the internet.
    How can this problem be repaired?

    There are various causes for this error, see [[Firefox is already running but is not responding]] for details.

  • Problem in getting the database connection from a connection pool

    Hai All,
    I am facing a problem in getting the database connection from a connection pool created on weblogic server 8.1.
    I am using the Oracle database 8.1.7.
    I have configured my connection pool, datasource and JNDI in weblogic.
    In my java program i have the following code to retrieve the connection.
    import java.sql.*;    
    import java.util.Hashtable;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    class jdbcshp1 {
        public static void main(String[] args) {
         Connection connection = null;
         try {
               Hashtable ht = new Hashtable();
               ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");  // Wanna get rid of this.
               ht.put(Context.PROVIDER_URL,"t3://localhost:7001"); // wanna get rid of this.
               // Get a context for the JNDI look up
               Context ctx = new InitialContext(ht);
            javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup ("myjndi1");
              //Create a connection object
              connection = ds.getConnection();
         The above code is working fine but, the two ht.put statements are creating problem.
    The problem is, after converting the application into WAR file it can be deployed
    on any machine or different port on same machine. My application fails if its deployed on
    weglogicserver which is at different port.
    Is there any way that i can get rid of those ht.put statements or any other way to solve the problem.
    any help is appreciated.
    Thanks in advance
    Pooja.

    Hai All,
    Firstly, thanks for ur reply.
    Even i have seen some code which uses context constructor with out any parameter and works fine.
    i dont understand why its not working for my code.
    When i remove those ht.put code and use context constructor with out any parameter, it giving an error.
    Context ctx = new InitialContext();
    javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup ("ocjndi");
    connection = ds.getConnection();The error is as follows:
    javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
    the above error is forcing me to include those code but if the port number is changed the code will not work. Plz let meknow if some setting have to be made.
    I appreciate all ur valuable help.
    Thanks once again.
    Pooja.

  • How to automatically remove the wiki page's images from the Images library , when a wiki page is deleted

    I have noted the following strange behavior inside my Publishing enterprise wiki site collection. Now by default when I create a new wiki page and I add Pictures to it, the pictures will be saved under the “Images” library and will be inside a unique folder
    that have its name similar to the page name.
    But when users delete the picture from the wiki page or they delete the whole wiki page, then the related folder inside the “Images” library will not be removed. So can anyone advice if there is a way to automatically remove the page’s pictures
    folder from the Images library when the page is deleted? as currently i might end up having many pictures inside the Images library which are not linked to a wiki page, and they will waste my server desk space...

    I think, not sure, there's no out-of-the-box solution in SharePoint for this problem. So I can only think of custom solution:
    In event Receiver, ItemDeleting, you can delete images. The only downside is if some other pages are referring the images..... you need to check somehow which is quite time-consuming operations if you have thousand of pages in wiki library
    A timer job, that will run periodically, every day or week, and clean all unused images. 
    Hide the default delete button and add your own. And then using your own custom layout page, show a 'configuration dialog' to user if they want to delete both page and images.
    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com
    Please do not tell me this is not supported out of the ox ,,,,, i that i should handle this process by myself !!! and SharePoint does not support this feature .... this is another  problem i should include in my list .....

Maybe you are looking for

  • Cannot obtain an appropriate JDBC type for class char.

    The above error while deploying...The full error is below. The only datatypes used are: integer, timestamp,string, decimal and date (so no char).  Can anybody help? Caught exception during application deployment from SAP J2EE Engine's deploy service:

  • File picked up XI but not placed in receiver

    Hi All, Im working on file to file scenario, i hav done with the design and configuration.The problem is the file is been picked up by the server but it is not placing in the receiver folder.Can anyone help, where to look for such files . Is there an

  • Security with Windows on an iMac OS X10.4

    If I load Windows XP on my iMac, am I going to run into the same horrific security issues I had with Windows? The reason I went to a Mac was to get rid of all the viruses, etc. Also, do I need a special version of XP for the Mac or just load the soft

  • Oracle Logo on Web Apps

    Does anyone know how to remove the Oracle logo that now appears when using the Oracle look-and-feel parameter in the startup html file? I would like to use the new reports, but that would mean that I would have to redesign all my screens due to the 1

  • Strange behaviour in ORacle Forms Webutil 106 / Error message WUC-14 WUC-12

    This is to inform you about a strange behaviour in Webutil V1.0.6 Hosting environment is Oracle Application Server 10.1.2.0.2 on Unix Solaris 10 Oracle Server 10.2.0.4.0 Enterprise Edition Client-envionment : Windows 2000, IE 6 I created an Forms bas