GSDP:GAM100/CProcessing/loadImageAdvanced()

From Inside
< GSDP:GAM100‎ | CProcessing
Revision as of 13:41, 5 October 2019 by >Zachary.logsdon
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

loadImageAdvanced()

Description

Images loaded using loadImageAdvanced() can be displayed using image display calls. The reference point used to draw the image can be specified with imageMode() . Using loadImageAdvanced() lets you set a few flags that are described below.

Parameters

loadImage(const char* path, bool copyPixelData, bool usePixelPerfectFiltering)

  • path - (const char *) The path of the image file on the hard drive
  • copyPixelData - (bool) Copies the pixel data of the image so it can be manipulated later
  • usePixelPerfectFiltering - (bool) Turns off bilinear smoothing for images, good for pixel art.

Example

PImage justin_face;
PImage tinted_justin_face;
int x_size, y_size;

void init()
{
  justin_face = loadImageAdvanced("./Assets/justin1.png", true, true);
  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:>