Skip to content

Instantly share code, notes, and snippets.

@nocarryr
Created June 21, 2018 17:19
Show Gist options
  • Save nocarryr/a4a72c6577d79633ecf11c2186e164f7 to your computer and use it in GitHub Desktop.
Save nocarryr/a4a72c6577d79633ecf11c2186e164f7 to your computer and use it in GitHub Desktop.
Processing test for image scaling
PImage srcImg;
PImage dstImg;
Float scaleW;
Float scaleH;
void setup()
{
size(1280, 720);
srcImg = loadImage("/mnt/resource/Shared Projects/modeling/testpatterns/1920x1080.png");
scaleW = float(width) / float(srcImg.width);
scaleH = float(height) / float(srcImg.height);
}
void draw(){
background(255);
image(srcImg, 0, 0, width, height);
//scale(scaleW, scaleH);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment