Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
OrganizationAdvent CalendarQiitadon (β)
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?


More than 5 years have passed since last update.



  1. Android端末にEPSONの無料プリントアプリ「EPSON iPrint」を入れる。

  2. Processingから画像のシェアを要求。

  3. シェアのリストから「EPSON iPrint」を選んで印刷。

import android.view.MotionEvent;
import android.content.Intent;
import android.net.Uri;
import android.os.Environment;
import android.app.Activity;

Intent intent;

void setup () {
    size (displayWidth, displayHeight, JAVA2D);
    colorMode (RGB, 256);
    background (255);
    intent = new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://" + Environment.getExternalStorageDirectory()));

void draw () {
    fill (random (256), random (256), random (256));
    ellipse (random (width), random (height), 20, 20);

void mouseReleased () {
    save_image ();

void save_image () {
    String img_name = Environment.getExternalStorageDirectory() + "/test_image.png";
    save (img_name);
    sendBroadcast (intent);
    print_out (img_name);

void print_out (String img_path) {
    Intent shareIntent = new Intent (Intent.ACTION_SEND);
    shareIntent.setType ("image/png");
    shareIntent.putExtra (Intent.EXTRA_STREAM, Uri.fromFile (new File (img_path)));
    startActivity (shareIntent);

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away