GSDP:GAM100/CProcessing/image()

From Inside
Jump to: navigation, search

image()

Description

Images loaded using loadImage() can be displayed using image() . The reference point used to draw the image can be specified with imageMode() .

Parameters

image(img, x, y, w, h, a)

  • img - (PImage) The loaded image to draw
  • x - (float) the horizontal position of the image
  • y - (float) the vertical position of the image
  • w - (float) the width of the image
  • h - (float) the height of the image
  • a - (int) the alpha to draw with

Example

void update()
{
    // Load an image from the assets folder to a PImage type
    PImage myImage = loadImage("./Assets/image.png");

    // display the image at the mouse position
    image(myImage, mouseX, mouseY, 100.0f, 100.0f, 255);

}

Related

Personal tools
Namespaces

Variants
Actions
Navigation
NameSpaces:>
Tools
Dynamic:>