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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:41:30+00:00 2026-06-06T20:41:30+00:00

I have an image element with src pointing to an Handler (asp.net), and this

  • 0

I have an image element with src pointing to an Handler (asp.net), and this image being used as source for Raster (PaperJs) object defined as global object and updated during window.load.

var raster;
paper.install(window);    
function WindowOnLoad() {    
    raster = new paper.Raster('MainContent_imageData');
    raster.position = paper.view.center;
    window.paper.view.draw();
}

The above code is loading image onto the canvas on first load then the image element is getting updated through a button click which is associated with callback control (ComponentArt callback control) but the canvas is not, it displays blank.

Then I created an handler that is being called after the callback is complete but it also didn’t work.

function CallBackCompleted(sender,eventArgs) {
    var imgData = document.getElementById('MainContent_imageData');
    raster.image = imgData ;
    raster.position = window.paper.view.center;
    window.paper.view.draw();
}
  • 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-06T20:41:32+00:00Added an answer on June 6, 2026 at 8:41 pm

    The following code fixed the issue. The raster object is added as a child object on layer[0] removed all the other objects except children[0], which refers to the raster object.

    function CallBackCompleted(sender,eventArgs) {
        if(window.paper.project.layers[0].hasChildren())
             window.paper.project.layers[0].removeChildren(1);
    
        var imageObj = new Image();
        imageObj.src = document.getElementById('MainContent_imageData').src;
        imageObj.onload = function () {
        window.paper.project.layers[0].children[0].setImage(imageObj);
        window.paper.project.layers[0].children[0].position = window.paper.view.center;
        window.paper.view.draw();
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an image tag enclosed in an anchor element like this: <a href='$image'><img
I have a Zend_Form with file element like this: ->addElement('file', 'image', array( 'required' =>
<input src=LOGO.JPG type=image name=imagem> I have an xml element that contains the image path
i have function that changes background color of element and src of image. in
I have the following image element that it's src does not exists. I want
I have some particular need to clone an element (image) and be draggable inside
I have an image that I want to move. I can move the element
I have a sprite image set as the background of an element on my
I have a DIV element with a background image and I am trying to
I just find an interest thing, when you change an element's src, it'll have

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.