Results 1 to 5 of 5

Thread: Graphics.drawImage

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Graphics.drawImage

    In the following code line what is 0 and -60 refering to?

    Is it the X and Y that the image is to be drawn at in the Graphics object g or is it the X and Y of the image offscreenImg to be extracted and drawn at 0, 0 in the object g?
    Code:
      '
      '
    g.drawImage(offscreenImg, 0, -60, this);
      '
      '

  2. #2
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: Graphics.drawImage

    X & Y of the clip the graphics object is drawing
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Graphics.drawImage

    So drawImage(image, 20, 20, this); will clip the image at 20, 20 and draw it on a Graphics object at 0, 0?

  4. #4
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: Graphics.drawImage

    The image is drawn with its top-left corner at (x, y) in this graphics context's coordinate space
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Graphics.drawImage

    Oh, just the opposite then of what I said above.

Posting Permissions

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



Click Here to Expand Forum to Full Width