Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Can you create an image from a jpg file using image(filename)?

edited March 2013 in General Posts: 557

Can you create an image from a jpg file using image(filename)?

Reason is I want to be able to detect size of a sprite based on the arbitrary jpg it's made from. Thought if I used the jpg to make an image instance, I could use image.width and image.height for the purpose. No?

Tagged:

Comments

  • edited March 2013 Posts: 12

    I think spriteSize(image) is what you're after.

  • Posts: 1,595

    You can use http.request(), a good example is in the reference manual on the keyboard tabs.

  • SimeonSimeon Admin Mod
    Posts: 5,008

    .@UberGoober if you have an image object, then image.width/height is the best way to go. These will give you the logical size of the image (in points) in case there is also a retina version.

  • Posts: 557

    @Simeon thanks for chiming in--the question is how to make that image in the first place. Image(filename) doesn't seem to work.

  • BriarfoxBriarfox Mod
    Posts: 1,542

    img = readImage()

  • Posts: 557

    Thanks!

Sign In or Register to comment.