Change Contents of the Bubble
View this PageEdit this PageUploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Comments on Week of 24 Jan 2005

Sorry! I'm late for updating this week!


Comments? Questions!


FYI, in case you'd like it for your collage-Mark Guzdial
  /**
   * Crop the picture from (x1,y1) to (x2,y2)
   **/
  public Picture crop(int x1, int y1, int x2, int y2)
  {
    Pixel currPixel;
    Picture target = new Picture((x2-x1),(y2-y1));
    
    for (int srcx = x1, trgx = 0; srcx < x2; srcx++, trgx++)
    {
      for (int srcy = y1, trgy = 0; srcy < y2; srcy++, trgy++)
      {
        // get the current pixel 
        currPixel = this.getPixel(srcx,srcy);
        
        /* copy the color of currPixel into target
         */
        target.getPixel(trgx,trgy).setColor(currPixel.getColor());
      }
    };
    return target;

  }




Mama Bear?? I think the pace is good thus far...

Baby Bear's, not Mama Bear. Sorry! Wrong reference. Baby bear's chair, porridge, and bed were "just right." Mark Guzdial




Link to this Page