GSDP:GAM100/CProcessing/imageCreateTint()

From Inside
Jump to: navigation, search

imageCreateTint()

Description

Returns a tinted copy of a PImage using an input PColor . You must have created the image using one of the advanced image functions and set the copyPixelData bool to be true.

Parameters

imageCreateTint(PImage srcImg, PColor tint)

  • srcImg - (PImage) The image to apply the tint
  • tint - (PColor ) The tint to apply to the image

Example

PImage justin_face;
PImage tinted_justin_face;
int x_size, y_size;

void init()
{
  justin_face = loadImageAdvanced("./Assets/justin1.png", true, false);
  tinted_justin_face = imageCreateTint(justin_face, color(255, 0, 0, 255));
  x_size = imageWidth(justin_face);
  y_size = imageHeight(justin_face);
}

float rotation = 0;
void update()
{
  background(color(255, 255, 255, 255));
  imageRotated(tinted_justin_face, mouseX, mouseY, 100, 150, 255, rotation);
  rotation++;
}

Related

Personal tools
Namespaces

Variants
Actions
Navigation
NameSpaces:>
Tools
Dynamic:>