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

  • Home
  • SEARCH
  • 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 8606107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:01:02+00:00 2026-06-12T03:01:02+00:00

This is probably a stupid & obvious question, but does anyone know how to

  • 0

This is probably a stupid & obvious question, but does anyone know how to change an image being displayed in a canvas using dropdown menus or radio buttons?

So if I had a red cloudy image and I wanted to replace it with, say, a green cloudy image, using the dropdowns/radios, how would I do it?

  • 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-06-12T03:01:03+00:00Added an answer on June 12, 2026 at 3:01 am

    Use the onChange-Event of the dropDown menu or radiobutton and call a javascript function, passing to it the name of the image.

    <input type="radio" name="cloud" value="red" onChange="javascript:imgChange('red.gif')"> Red cloud<br>
    <input type="radio" name="cloud" value="blue" onChange="javascript:imgChange('blue.gif')"> Blue cloud<br>
    <input type="radio" name="cloud" value="green" onChange="javascript:imgChange('green.gif')"> green cloud
    

    Using javascript you can now build a function to change the image.

    function imgChange(var img){
        var c=document.getElementById("myCanvas");
        var ctx=c.getContext("2d");
        var img = new Image;
        // set your image according to the parameter
        ctx.drawImage(img,10,10);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is probably a stupid question. I don't know anything about Web Service but
This is probably a stupid question, but does object Properties occupy any memory per
This is probably a stupid noob question but what does the : represent in
This is probably something stupid, but I don't know nearly enough about rails &
Possible Duplicate: PHP: Opening/closing tags & performance? this is probably a stupid question, but
this is probably a stupid question but I can't seem to find the answer.
This is probably a stupid question, but how much of a security risk is
This is probably a stupid question, but what exactly is a non-blocking web server?
This is probably a stupid question, but what's the best way to clear class
i know this is probably a stupid question and i know js scope questions

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.