×

Discussion Board

Results 1 to 2 of 2

Thread: Crop It Pys60

  1. #1
    Registered User
    Join Date
    Oct 2007
    Posts
    2

    Smile Crop It Pys60

    Hi there,
    I was wondering if there is a module or trick or anything in pys60 that could help me crop a part of an image.
    and of course i dont want to crop the image by reading it pixel by pixel,i need a fast function.
    also i wanted to know if there is a IMAGETOSTRING or something like that ,like what we have in pygame (i`m talking about pygame.image.tostring() function) in pys60 too.
    thanks.
    Last edited by sh_teta; 2009-06-23 at 16:27.

  2. #2
    Nokia Developer Moderator
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: Crop It Pys60

    Hi,

    As far as I can tell the documentation doesn't mention anything useful about cropping so the only way to do it is to create a new image of the size you want and use its blit method to copy the portion of the image you want to crop on it.

    Here's what I mean:
    1. You have the Image object img1. You want to crop the rectangle situated beween (20,20) and (70,90).
    2. Create a new Image object called img2, of size 50x70
    3. Call img2.blit(img1, source=((20,20),(70,90)))

    Now img2 will contained the cropped version of the initial image, img1.

Similar Threads

  1. New to Python for S60 (PyS60)? Read this first!
    By croozeus in forum Nokia N9
    Replies: 2
    Last Post: 2008-10-17, 19:23

Posting Permissions

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