none
Resizing an Image RRS feed

  • Question

  • I'm using a picture as my movable "player" in my game, and I want the loaded image to be smaller. I don't know how to resize it as it has been loaded in as a shape. Here is my import code : RLN596. Any help would be greatly appriciated, as I need to finish this code in the next hour!
    Friday, November 30, 2012 7:21 PM

Answers

  • For zoom there is -> Shapes.Zoom().

    But you still have to take into account the original image's dimensions for repositioning adjustments:

    ImageList.GetWidthOfImage() & ImageList.GetHeightOfImage(). (Warning: those methods don't work on Silverlight browser plugin)

    Also, there is a subtle bug in your program:

    You're not creating shapes outta the images you've just loaded using ImageList.LoadImage()!

    Rather you're just re-downloading it all over again w/ player = Shapes.AddImage(person) @ Sub Begin.

    That happens b/c the variable person still points to either Janis, Cady, or Damian variables, which are the URLs strings to download images from.

    It's not a big deal, but if you want to fix that, just make -> person = ImageList.LoadImage(person).

    That way now, person points to the image name already loaded in memory, not the URL anymore!


    Click on "Propose As Answer" if some post solves your problem or "Vote As Helpful" if some post has been useful to you! (^_^)

    Friday, November 30, 2012 8:11 PM
    Answerer
  • To zoom an image, you can use Shapes.Zoom. However, to absolute resize, you would need to know the current height and width, and the future height and width. You can absolute resize by using Shapes.Zoom( ImageNameNewWidth / Width, NewHeight / Height ). The underlined words in there are just names for variables you would need to fill in with appropriate values correspondent to their name.

    I am a 10 year old that loves math, games, and computers. 'Binary is as easy as 1, 10, 11.'

    Friday, November 30, 2012 11:07 PM

All replies

  • For zoom there is -> Shapes.Zoom().

    But you still have to take into account the original image's dimensions for repositioning adjustments:

    ImageList.GetWidthOfImage() & ImageList.GetHeightOfImage(). (Warning: those methods don't work on Silverlight browser plugin)

    Also, there is a subtle bug in your program:

    You're not creating shapes outta the images you've just loaded using ImageList.LoadImage()!

    Rather you're just re-downloading it all over again w/ player = Shapes.AddImage(person) @ Sub Begin.

    That happens b/c the variable person still points to either Janis, Cady, or Damian variables, which are the URLs strings to download images from.

    It's not a big deal, but if you want to fix that, just make -> person = ImageList.LoadImage(person).

    That way now, person points to the image name already loaded in memory, not the URL anymore!


    Click on "Propose As Answer" if some post solves your problem or "Vote As Helpful" if some post has been useful to you! (^_^)

    Friday, November 30, 2012 8:11 PM
    Answerer
  • To zoom an image, you can use Shapes.Zoom. However, to absolute resize, you would need to know the current height and width, and the future height and width. You can absolute resize by using Shapes.Zoom( ImageNameNewWidth / Width, NewHeight / Height ). The underlined words in there are just names for variables you would need to fill in with appropriate values correspondent to their name.

    I am a 10 year old that loves math, games, and computers. 'Binary is as easy as 1, 10, 11.'

    Friday, November 30, 2012 11:07 PM