Quantcast
Channel: Android Mode - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 941

Android loadImage outside sketch folder.

$
0
0

Hi. I am trying to load an image with the code below, but this will give the error:

The method loadImage(String) in the type PApplet is not applicable for the arguments (File) >

How to do this? Thanks.

import android.os.Environment;

   PImage img;
   File f;

   String baseDir = Environment.getExternalStorageDirectory().getAbsolutePath() + "/imgFolder";
   String fileName = "noel_28_5_2018_9_9.png";
   f = new File(baseDir + "/" + fileName); 
   img = loadImage(f);

Viewing all articles
Browse latest Browse all 941

Trending Articles