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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:47:50+00:00 2026-06-06T22:47:50+00:00

Hi RaphaelJS users =) , I have maybe a dumb-ish question, but I can’t

  • 0

Hi RaphaelJS users =) ,

I have maybe a dumb-ish question, but I can’t seem to find the answer, the thing is, I’m trying to load/create an image with Raphael, that’s fine, like this:

var image_1 = paper.image('/img/img1.jpg', 0, 0, 100, 100);

But as you can see, it always seems like you have to give the “width” and “height” properties, I already checked the documentation, but it’s always short and not that’s detailed, and I tried giving null parameters or empty parameters, but it doesn’t work…

So I’m wondering if there is actually a direct way in raphael to do this, or….do I have to always get those values before???

I mean, something like this?:

var imgURL = "../img/img1.jpg"

var myImg = new Image();
myImg.src = imgURL;

var width = myImg.width;
var height = myImg.height;

   //create the image with the obtained width and height:
    var image_1 = paper.image('/img/img1.jpg', 0, 0, width, height);

And so that way I load with the original size of the image and that kinda solves my problem, but….isn’t there way inside Raphael to do this???

  • 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-06T22:47:52+00:00Added an answer on June 6, 2026 at 10:47 pm

    For now…I guess I’ll have to answer my own question with my own answer, cause there seems to be no other way that I’ve found or that someone has told me =P

    var imgURL = "../img/img1.jpg"
    
    var myImg = new Image();
    myImg.src = imgURL;
    
    var width = myImg.width;
    var height = myImg.height;
    
       //create the image with the obtained width and height:
        var image_1 = paper.image('/img/img1.jpg', 0, 0, width, height);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get the scaling animation to work with RaphaelJS, but I'm having
I have RaphaelJS based canvas, where user can do some work. I need to
This may be a very dumb question, but how do I draw a path
Possible Duplicate: Raphaeljs and Internet Explorer, problem when clicking an element I'm trying to
I'm very new to javascript and raphaelJS, so sorry for my messy code, but
I am trying to construct a customized map in raphaeljs , in this i
I have previously worked with Raphael, but I have returned to my project and
I'm playing with RaphaelJS, and can't figure out how to make created text draggable?
I was trying to draw the raphaeljs piechart. I used the same example as
I know this isn't a straightforward question but I would really appreciate some feedback

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.