×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Dec 2005
    Posts
    49

    Copying images to canvas

    Hello Every One!

    I am copying images to the screen through canvas.blit(photo). i m to some extent successfull with that.

    now i am trying to copy another two small images to the top of the screen. canvas.blit(signal_image,(5,5))
    in the above example the first 5 is (i assume) the x co-ordinate
    and the second is y co-ordinate
    and
    canvas.blit(battery_image,(40,50))

    but the result what iam getting is the signal_image draws to the screen while the battery_image doesnt.

    am i doing it correctly if yes then whats the problem if no then please correct me.

    thanks..

  2. #2
    Registered User
    Join Date
    Feb 2008
    Location
    Moscow Russia
    Posts
    25

    Re: Copying images to canvas

    I would make so
    Code:
    import graphics
    body=graphics.Image.new((20,20))
    body.blit(signal_image,(5,5))
    body.blit(battery_image,(15,5))
    canvas.blit(body)

  3. #3
    Registered User
    Join Date
    Dec 2005
    Posts
    49

    Re: Copying images to canvas

    Hello Versoul!

    body=graphics.Image.new((20,20))

    in the above line the first 20 is the x co-ordinate and the second one is y.

    and the same for the others.
    m i right?

    Thanks..

  4. #4
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: Copying images to canvas

    Quote Originally Posted by anees042 View Post
    Hello Versoul!

    body=graphics.Image.new((20,20))

    in the above line the first 20 is the x co-ordinate and the second one is y.

    and the same for the others.
    m i right?

    Thanks..
    Actually those are the dimensions of the new, blank image (20 pixels wide, 20 pixels high). You could think of them as x,y coordinates, but they are dimensions.

  5. #5
    Registered User
    Join Date
    Dec 2005
    Posts
    49

    Re: Copying images to canvas

    Hello Galiceanu!

    so these are dimensions, where will be the new blank image copied to?
    is there a way to specify a certain position on the screen to copy the image to?

    can you give me explanation of the blit() method?

    blit(image, source, target)

    Thanks in advance

  6. #6
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: Copying images to canvas

    blit(image, target, source)

    image is the image you want to blit
    target is where you want to blit it on the other image (x,y)
    source is the portion of the image you want to blit (x1,y1,x2,y2)

Similar Threads

  1. How to create a partly transparent Canvas to lay on top of another Canvas?
    By mkleijer in forum Mobile Java Media (Graphics & Sounds)
    Replies: 4
    Last Post: 2007-05-22, 07:00
  2. Major problem with delegation to Canvas
    By bartekn in forum Mobile Java Media (Graphics & Sounds)
    Replies: 8
    Last Post: 2003-10-08, 17:46
  3. copying images
    By EvilCartman in forum Mobile Java Media (Graphics & Sounds)
    Replies: 12
    Last Post: 2003-08-22, 17:06
  4. Copying or moving images or files to and from PC and Nokia 3650
    By hoongming in forum General Messaging
    Replies: 0
    Last Post: 2003-05-20, 07:00
  5. Copying or moving images to and from Nokia 3650 from PC
    By hoongming in forum Symbian Tools & SDKs
    Replies: 0
    Last Post: 2003-05-19, 09:54

Posting Permissions

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