Howdy, Stranger!

We are about to switch to a new forum software. Until then we have removed the registration on this forum.

  • How to convert a string into an image

    @RockyHawk --

    You can, and I also want to strongly emphasize this works best for setup or a one-time loader function: do not call loadImage() in draw(). Most of the the time this is a mistake -- and a terrible performance hit.

    Calling loadImage every time an image is needed in a running sketch is solving "how do I choose between different cereals for breakfast?" is "order a new cereal box from Amazon every time you feel hungry, then sit and wait until it arrives." It works, but now you sitting at the breakfast table for two days waiting for your cereal -- and you only eat breakfast every two days.

  • Trying to make a image a button but cant seem to get it right

    the image is like a rectangle

    so you need to check

    • if mouseX is bigger than upper left corner and

    • if mouseY is bigger than upper left corner

    but also both must be inside the rectangle, so they must be smaller than lower right corner (which is

    • upper left corner plus width of image for mouseX and

    • upper left corner plus height of image for mouseY ) :

    So this is the if-clause:

          if (
            mouseX > Lidnt_BunnyX && 
            mouseX < Lidnt_BunnyX + Lidnt_BunnyWidth && 
            mouseY > Lidnt_BunnyY && 
            mouseY < Lidnt_BunnyY + Lidnt_BunnyHeight) {
            BunnyCount++;
            consolePrint();
          }
    

    OK?

    Chrisir ;-)

    //Carmine 
    //
    //Lab 3
    //
    
    PImage ChocolateEggs;
    //source for image https : // groceries.morrisons.com/webshop/product/Cadbury-Mini-Eggs-Chocolate-Easter-Egg/309447011
    PImage Peeps;
    //Source for image https : // www.amazon.com/Peeps-Marshmallow-Candy-Bunnies-Yellow/dp/B001HZWWQW?th=1
    PImage Lidnt_Bunny;
    //source for image https : // www.amazon.com/Lindt-GOLD-BUNNY-Chocolate-Ounce/dp/B000OVRIDW
    PFont f;
    int BunnyCount;
    
    
    int Lidnt_BunnyX, Lidnt_BunnyY;// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    
    void setup() {
      size(600, 400);
      background(35, 164, 214);
    
      ChocolateEggs= loadImage("ChocolateEggs.jpg");
      Peeps= loadImage("Peeps.jpg");
      Lidnt_Bunny= loadImage("Lindt_Bunny.jpg");
    
      f = createFont("ComicSansMS-48.vlw", 14);
    }
    
    void draw() {
      //draws images
      // ChocolateEggs.resize(100, 100);
      // image (ChocolateEggs, 50, 150);
      // Peeps.resize(100, 100);
      //image (Peeps, 200, 150);
      Lidnt_Bunny.resize(100, 100);
    
      image (Lidnt_Bunny, 350, 150);
      Lidnt_BunnyX=350;  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
      Lidnt_BunnyY=150;
    
      textFont (f, 18);
      fill(214, 35, 184);
      text ("Chocolate Eggs:", 50, 265);
      text("88 Pieces $5.99", 50, 285);
      text("Lindt Bunny:", 350, 270);
      text("3.5 oz $4.00", 350, 285);
      text("Peeps:", 200, 265);
      text("15 Count $2.99", 200, 285);
    }
    void mousePressed() {
      int Lidnt_BunnyWidth=Lidnt_Bunny.width;
      int Lidnt_BunnyHeight=Lidnt_Bunny.height;
      //if (mouseButton==LEFT){BunnyCount++;} else {BunnyCount=0;}
      //detects is mouse is clicked in image button
      if (
        mouseX > Lidnt_BunnyX && 
        mouseX < Lidnt_BunnyX + Lidnt_BunnyWidth && 
        mouseY > Lidnt_BunnyY && 
        mouseY < Lidnt_BunnyY + Lidnt_BunnyHeight) {
        BunnyCount++;
        consolePrint();
      }
    }
    
    void consolePrint() {
      print("Number of Choclate Bunnies "+ BunnyCount+ ". ");
    }
    
  • Trying to make a image a button but cant seem to get it right

    I am still learning a lot of things about processing since i have only been using it for a couple months, i am making a program for a lab for class and cant get the code to make the image a button work properly, i have looked at a lot of other posts on forums and cant find something that works the way i need it to. also i need to have the image loaded from the data folder because a lot of the examples ive seen they dont use it that way.

    currently i am trying to make the Lidnt_Bunny the button and cant seem to get it, it probably is a simple error im making but hoping i can get some help, thanks in advance i appreciate all the help i get on here.

    also is there a way to make the line that prints to the console just update the variable and not reprint the statement each time it is printed?

    //Carmine 
    //
    //Lab 3
    //
    
    PImage ChocolateEggs;
    //source for image https://groceries.morrisons.com/webshop/product/Cadbury-Mini-Eggs-Chocolate-Easter-Egg/309447011
    PImage Peeps;
    //Source for image https://www.amazon.com/Peeps-Marshmallow-Candy-Bunnies-Yellow/dp/B001HZWWQW?th=1
    PImage Lidnt_Bunny;
    //source for image https://www.amazon.com/Lindt-GOLD-BUNNY-Chocolate-Ounce/dp/B000OVRIDW
    PFont f;
    int BunnyCount;
    
    
    void setup() {
      size(600, 400);
      background(35, 164, 214);
      ChocolateEggs= loadImage("ChocolateEggs.jpg");
      Peeps= loadImage("Peeps.jpg");
      Lidnt_Bunny= loadImage("Lindt_Bunny.jpg");
      f = loadFont("ComicSansMS-48.vlw");
    }
    
    void draw() {
      //draws images
      ChocolateEggs.resize(100, 100);
      image (ChocolateEggs, 50, 150);
      Peeps.resize(100,100);
      image (Peeps,200,150);
      Lidnt_Bunny.resize(100,100);
      image (Lidnt_Bunny,350,150);
      textFont (f, 18);
      fill(214,35,184);
      text ("Chocolate Eggs:",50,265);
      text("88 Pieces $5.99",50,285);
      text("Lindt Bunny:",350,270);
      text("3.5 oz $4.00",350,285);
      text("Peeps:",200,265);
      text("15 Count $2.99",200,285);
     }
     void mousePressed(){
       int Lidnt_BunnyWidth=Lidnt_Bunny.width;
       int Lidnt_BunnyHeight=Lidnt_Bunny.height;
       //if (mouseButton==LEFT){BunnyCount++;} else {BunnyCount=0;}
         //detects is mouse is clicked in image button
      if(mousePressed== true && mouseX<Lidnt_BunnyWidth && mouseY<Lidnt_BunnyHeight){
         BunnyCount++;
    
     }
     }
    
     void consolePrint(){
       print("Number of Choclate Bunnies "+ BunnyCount);
    
     }
    
  • Sharing Programs With Non-Processing 3 Users

    To share actual files, and if you don't mind sending it manually to each user, I recommend https://wetransfer.com/

    Something automatic... you can search in the forum for amazon and see what people has tried so far: https://forum.processing.org/two/search?Search=amazon

    Note I use Amazon as it is a keyword search here in the forum... no idea how easy is to use and I cannot comment on their services either.

    Kf

  • Your best Processing.py references

    This Python mode channel in the forum is what I'm familiar with.

    If you are looking for a book, Allison Parrish wrote "Getting Started with Processing.py". Her book is here:

    https://www.amazon.com/Getting-Started-Processing-py-Interactive-Processings/dp/1457186837

  • How can I scan a plant of a room with Arduino and draw it in Processing?

    Can you give me any amazon link or any blog page that speaks about it?

  • No Export

    nabr,

    Submission failed at Amazon. I uploaded the zip file for binary and identified the readme file (in the zip) for installer executable file.

    Amazon's Reason : Your binary is rejected for not having a valid installer the user can find upon download. Please have all relevant components available for the user to install this software to their system.

    I think I'm going to suspend uploading to Amazon for a while as not only that they do not have clarity on what is their executable but also that they are not very responsive.

  • No Export

    Thanks for responding to every bit of my doubts. Your post is very useful.

    The reason I wanted everything to be handy in the app is simply because artists know anything abt Java/Processing etc. So, to ask them to download and install Java is like asking them the moon. Also, I did go through the amazon faqs and uploaded the applications.windows32 as a zip file with Java folder included (in the zip itself). I changed the zip filename of course. But, like you said, I'll identify the readme file for the installer executable file name so it gets easy for the approval team to understand. Btw, the app is still 'queued' at amazon as they haven't responded for over a month. Will try to seek other platforms like the one you mentioned. Thanks again.

  • No Export

    Hello
    already good answers here. Usually you are going for a 32bit App, unless want do something crazy like an Videoeditor, or modern 3D Shooter with Megatextures, Hybrid -Raytracing, Forward Shadow Mapping and SSAA, - kind of Doom 4 situation.

    • Yes, the user has to install Java on the Machine. You have to write a Readme including this Information.

    For the Enduser with zero experience, the steps would be: go to the Oracle -Website, download and install the Java lib, wait til installation has finishend. Lanch your Application. ~ 5min, done.
    Your app is worth it : )
    I think you have to build up a community first, and downloading the Java files within your app would be kind of painful (whit your next release).
    To download your 32bit App and then separate Java download you make sure, your "fans" already have the java environment installed and only download the newest content.

    Big advantage is the smaller file size to download and slightly faster loading time (on 64x). Also 32bit runs on 64x architecture, not vice versa. So you can compile 32 bit for Mac+Linux+Windows and don't worry about it, also not if the User is on a 64x architecture. If you compute everything on the CPU the required work stored inside your RAM, implies you can address up to 4GB Ram with your awesome App, and that's a lot!
    Also "a lot of Ram" for running other Apps on the Desktop of the User like a Browser, and Videorecorder, maybe to make a Play trough, or Youtube Review of your app. 64x means the Computer is ready to allocate the memory for your App in particular, this instruction might conflict with an also expensive Application running at the same time. (On Notebook/ Android it is also matter of Battery life. )
    Special case as mentioned with Videoeditor would be, if you do some Imageprocessing you have to decompressed your images .jpg .png to a RAW Data Type, (1024x1024x4)~RGBA and push the pixels inside the RAM, could end up as expensive computation, - but in general it should work.

    Also try previous versions of processing. 2.1.1 e.g https://processing.org/download/ Just to avoid confusion, with 64x vs 32bit and also get fimilar with Amazon in first place and not worry about Java 1.8 etc.

    And to merge your other topic:

    https://developer.amazon.com/de/docs/mac-pc/faq.html

    identify the folder as the “Binary” and identify the readme file as the “Installer executable file name”.

    Easy peasy.

    Side note: Yes, amazon is okay, but also more focusing on sales, i think. If you just experimenting, there are tons of other platforms,more easily to access and get through verification. https://itch.io/

    Edit: So i'm talking about the executable file created for each OS, that is pointing to the .jar files, for the exucution of the *jar files inside the JVM it doesn't matter if the bytecode referring to 32bit or 64bit. So the workaround instead of an ".exe" could be, to create a bash/shell script and point the java installation.

  • No Export

    Sure, will do that. Hope to get some response at stack overflow. I'm curious to know what ppl in the forum do with their exported applications, if they are not distributing through platforms like Amazon, etc. Or, are they just going in for android? Also, it will be helpful to know how your exporting resulted, if you tried it. Thanks.

  • No Export
    1. If there is no export in file, how do I export as applet for web?
    2. No, Java not installed on the other computers, I think.
    3. I exported with Java embedded as a standalone application. The applications.windows32 folder was compressed into a zip folder. I uploaded and the response was the installer (exe) did not launch when downloaded.
    4. I uploaded in Amazon as per its documentation of uploading a zip or exe for the app binary for pc and mac apps. So, I was thinking of exporting as an applet. But, now not able to find the file>export.
  • PC app stores

    The link is for android. I've posted twice in App store and PC and mac issues. No response. Mails to them have also not elicited any. Why I'm posting in Processing is because the response from Amazon team is that the exported app (exe) is not launching whereas it works fine in my PC.

  • PC app stores

    Thanks. Amazon is not much help. They don't bother to respond. Still, here is their faq link: https://developer.amazon.com/docs/mac-pc/faq.html . Their guidelines simply say that developer has to upload the binary, which can have a .exe (installer executable) in its zip file, (ie zip can be uploaded for binary). The pde which is exported as .exe does not seem to launch. So, why the exported pde, which is now an executable not launching. Java folder is also included. So, that's my doubt. Btw, is there any other way to distribute PC apps other than manually sending it to others' PCs? Any other platform that will not have trouble with Processing apps? Any idea?

  • PC app stores

    I am not used to exporting my code... I would assume that when you export, you can move that folder into any machine (with the same OS) and run it. Those target machines don't need to have Processing install. I wonder about java (even any java conflict if present in the target machine but different to the one that comes in the deployment folder.... anyways this is for another question). I will let other ppl clarify that part.

    This is from the next link https://github.com/processing/processing/wiki/Export-Info-and-Tips :

    When distributing your application, the "source" folder can be removed from the export if you'd like, but other files (such as the lib folder and any .dll files or whatever) should be left intact otherwise the application will not work.

    Related to the amazon part, can you provide a link? Also check if they have some guidelines that you need to follow.

    Kf

  • PC app stores

    Amazon documentation mentioned uploading a binary, that is, a .zip file containing an executable for pc and mac apps. So I clicked export application in the the .pde, and ticked embed Java (as I read in this forum that Java was the installer) and compressed the resultant folder (applications.windows32) into a .zip and uploaded. The zip folder had a .exe file. What have I done wrong? Is Java not the installer? Feeling stuck here. Pl help.

  • PC app stores

    My submission at Amazon failed as it said the installer does not launch when downloaded. I've embedded java when exporting the application. So, there is a java folder in the applications.windows32 folder. That java folder is the installer, right? If so, why has the submission failed due to installer not launching?

  • PC app stores

    I'm a novice with Processing - an artist trying to dabble in coding art related app. I've built an app and want to submit to app stores that allow apps for PC (not android or mobile apps). Are there any app stores where I can submit/publish my app, other than Amazon?

  • How to tell where the user is pointing with a kinect

    No, seriously, this is a startup idea.

    You know the sonos room speakers or the amazon echo / alexa etc.

    But now instead imagine you had your arduino and kinect as a nice slim box in your living room.

    It could detect your gestures and you could switch on lights, television or music just by pointing. Amazing! I mean, I would buy it. It's more natural than speaking to the amazon echo.

    It would have a teach mode where you teach it lamp locations once and for all and then use it throughout (always on).