GSDP:GAM100/CProcessing/imageSize()

From Inside
Jump to: navigation, search

imageSize()

Description

Used to get the width and height in pixels of the loaded image.

Parameters

imageSize(PImage img, int* w, int* h)

  • img - (PImage) The loaded image to check
  • w - (int*) The pointer to where to store to store the width of the image.
  • h - (int*) The pointer to where to store to store the height of the image.

Example

PImage justin_face;
int x_size, y_size;
void init()
{
  justin_face = loadImage("./Assets/justin1.png");
  imageSize(justin_face, &x_size, &y_size);
}

void update()
{
  background(color(255, 255, 255, 255));
  image(justin_face, mouseX, mouseY, x_size, y_size, 255);
}

Related

Personal tools
Namespaces

Variants
Actions
Navigation
NameSpaces:>
Tools
Dynamic:>