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 5998017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:20:46+00:00 2026-05-23T00:20:46+00:00

This is a function of a json object. canvas param is a canvas with

  • 0

This is a function of a json object. canvas param is a canvas with image loaded and canvasCtx is a context of the canvas. The problem is that when i move the slider, the canvas is edited only once and if i move it again nothing happens. But if i add the strings that i marked, everything works fine. Why?

EditBrightness : function(canvas, canvasCtx)
{
    var image = new Image(); // image that is used as default image for current operation       

    image.onload = function() {         

        var sliderLayout =  "<div header='Brightness'>" + 
                                "<span></span><br />" +
                                "<div></div>" +
                            "</div>";       

        var dialog = $(sliderLayout).dialog();

        $('div', dialog).slider({
            max : 150,
            min : -150,
            change : function (event, ui) {

                var canvas = $("#edit_canvas")[0];       // <-- Those are
                var canvasCtx = canvas.getContext('2d'); // <-- the strings

                $('span', dialog).html(ui.value);

                canvasCtx.drawImage(image, 0, 0);

                Pixastic.process(canvas, "brightness", {
                    brightness : ui.value
                });
            }
        });
    };

    image.src = canvas.toDataURL();
}
  • 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-23T00:20:46+00:00Added an answer on May 23, 2026 at 12:20 am

    Probably because you change canvas, canvasCtx variables which you pass to this method somewhere outside the code which you show us.

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

Sidebar

Related Questions

I have a function to sort a JSON object that looks like this: function
I need to encode a javascript function into a JSON object in PHP. This:
code //array store the markers var googleMarker = []; //this function get json object
I have a success function that gets an object: success: function(json) { } json
$.post($(this).attr(action), $(this).serialize(), function(json) { alert('red'); AddItemAjax(json); }, json); This works in Chrome but not
This function is generating a array with json objects on it: var estoque={}; function
i have a script that calls a php file and gets an JSON object
function JsonCall() { JsonClient.setRequestHeader(Content-type, application/json); JsonClient.send(Data); JsonClient.onload = function() { SomeOtherFunction(this.responseText); } } //
I have an extremely simple JSON object that looks like the following: var data
I have JSON object inside variable like this: var chessPieces = { p-w-1 :

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.