Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6839445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:43:12+00:00 2026-05-26T23:43:12+00:00

I have the functions in place that will render the drawing according to the

  • 0

I have the functions in place that will render the drawing according to the listed function, my question is how can I send that drawing to the function? (My input tag attempt is listed below the function js.)

Here is the function that will handle the final image–>

 function recurseImage() {   
    img = new Image();  
    img.src = myCanvas.toDataUrl();  
    fr1 = makeFrame(ctx, makeVect(400,0), makeVect(400, 0), makeVect(0, 400));
    img.onload = function(){ 
            ctx.save(); 
            newPainter = cornerSplit(imagePainter,5);
            newPainter(fr1);     
            ctx.restore();
            ctx.save();
            newPainter(flipHorizLeft(fr1));
            ctx.restore();
            ctx.save();
            newPainter(flipVertDown(fr1));  
            ctx.restore();
            ctx.save();
            newPainter(flipVertDown(flipHorizLeft(fr1)));   
}  

}

<input type="button" name="recurseImage" id='recurseImage' value="Recurse It"    onClick"recurseImage()"/>

My hope is to allow the user to simply click a btn that will send the newly created canvas image into this function and display the ‘recursedImage’ in a separate window that the user can save as a png file if they desire. I pre-thank you and any suggestions would be very much appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:43:12+00:00Added an answer on May 26, 2026 at 11:43 pm

    Here’s a working example: http://phrogz.net/tmp/canvas_recursion.html

    Here’s the code:

    var img = new Image;
    var levels = 0;
    img.onload = function(){
      if (++levels>4) return;
      ctx.drawImage(img,0,0,320,240);
      ctx.drawImage(img,320,0,320,240);
      ctx.drawImage(img,320,240,320,240);
      ctx.drawImage(img,0,240,320,240);
      setTimeout(function(){ img.src = ctx.canvas.toDataURL() },1000);
    };
    img.src = 'gkhead.jpg';
    

    Generalized:

    var img = new Image;
    img.onload = function(){
      if (allDoneRecursing()) return;
      drawNewImageToContext();
      img.src = ctx.canvas.toDataURL();
    };
    img.src = seedImageSrc(); // You may want a toDataURL() on another canvas here
    

    Note that this uses an image as the intermediary for the recursion, which should be fine as long as you’re not upscaling the result on each iteration. If you need actual scaled/transformed canvas context commands to be composited, please say so.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have functions in place that will convert the results of sql queries into
I'm trying to implement an ActionMailer function that will send out a newsletter to
I have functions that contribute to small parts of a figure generation. I'm trying
in writing a scripting engine, I have functions like (psuedo-code) function is_whitespace?(char c){ return
I have two functions that have different enough logic but pretty much the same
I have two functions in an ActionScript class, they are: private function loaderCompleteHandler(event:Event):void {
I have numerous functions (unknown at design time) that each take a specific number
I have 2 functions on a seperate page that I am including of the
I have 2 functions that needs to be executed one after the other. In
I'm writing a script that will allow a user to input a string that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.