×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Nov 2009
    Posts
    2

    Question Urgent-accessing a new image from the prev image by ptr press in touchscreen

    I am developing an application for showcasing internal mapping of my college.
    now the problem is to access a new map(staffroom) from previous map( top view of floor) .i want that on clicking of staffroom area in a complete top view of a floor ,detailed map of staffroom replaces the previous one in the same canvas.

    for this i tried a code but that's not working
    :
    protected void paint(Graphics g)
    {

    if((lastPointerX> 269 & lastPointerX < 300)& (lastPointerY> 217 & lastPointerY< 238))
    {

    g.drawImage(staffroom,0,0, Graphics.TOP | Graphics.LEFT);


    }

    else
    g.drawImage(topview,0,0, Graphics.TOP | Graphics.LEFT);

    }

    Need help urgent...
    Last edited by dee0dee; 2009-11-10 at 17:56.

  2. #2
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Urgent-accessing a new image from the prev image by ptr press in touchscreen

    I think you should use && instead of & in

    if((lastPointerX> 269 & lastPointerX < 300)& (lastPointerY> 217 & lastPointerY< 238))

  3. #3
    Registered User
    Join Date
    Nov 2009
    Posts
    2

    Re: Urgent-accessing a new image from the prev image by ptr press in touchscreen

    thx for replying..
    i have tried that option too..
    but the problem occurring now is that once i clicked in that specified place the new image comes up, but once i click again at any other place the previous image comes on the canvas..
    so the new image is not stable on the page.

    any solution for that??

  4. #4
    Regular Contributor
    Join Date
    Jun 2009
    Location
    Tel-Aviv Israel
    Posts
    410

    Re: Urgent-accessing a new image from the prev image by ptr press in touchscreen

    yes, each Image should be in an object that has a boolean (visible/not visible), with its bounds set(x,y,width,height), and touch event handling methods(pressed dragged released).
    Thanks,
    Adam Zehavi.

  5. #5
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Urgent-accessing a new image from the prev image by ptr press in touchscreen

    personally i'd make a global Image value called imageToDisplay...
    Then I'd use the three pointer methods (pointerPressed(), pointerReleased(), pointerDragged) to establish which Image should be shown onscreen, and assign this Image to imageToDisplay...

    afterfards in the paint method you only need to continuesly paint imageToDisplay...

Similar Threads

  1. Opening a JPEG Image
    By ummarbhutta in forum Mobile Java Media (Graphics & Sounds)
    Replies: 8
    Last Post: 2007-02-15, 06:34
  2. how to cut some part of Image
    By mshouab in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2006-08-04, 09:05
  3. HELP: Mutable Image to Immutable Image?
    By rj_cybersilver in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2005-03-26, 09:58
  4. Nokia Image Converter
    By davidpurdie in forum General Development Questions
    Replies: 0
    Last Post: 2004-02-18, 15:31
  5. Accessing to image DATA
    By lazmous in forum Mobile Java General
    Replies: 1
    Last Post: 2003-04-08, 09:06

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×