×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    82

    Copy only a part of an image

    Hi,

    I just wanna know what's the best method to only copy a region of an image. (without using copyRegion that is MIDP 2).

    Thanks

  2. #2
    Regular Contributor
    Join Date
    May 2003
    Posts
    151
    You mean copy it to another image ? Can't you just get the 'graphics' of where you want to copy it to and turn the clipping on, before drawing it into the new image ? eg.

    Image source; // the image to be copied
    Image copy = Image.createImage(source.getWidth(), source.getHeight());

    Graphics g = copy.getGraphics();

    g.setClip( 8, 8, 8, 8 );

    g.drawImage(source, 0, 0, TOP|LEFT );


    Which should copy an 8by8 chunk of the first image.


    btw It's a bit quiet in here init ?

  3. #3
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    82
    yeah it' will do the trick

    thanks

Posting Permissions

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