Antônio Gomes wrote:
Might I ask why you're not just using naturalWidth and naturalHeight (on nsIDOMNSHTMLImageElement)?

Two reasons:

1) Such access to the DOM style is much slower (4 times at least) than using the imgContainer (measuring the time manually).

I'm not talking about style. I'm talking about naturalWidth and naturalHeight. They have nothing to do with style.

2) I thought I could use both "get and set size" methods through imgContainer, but it seems to let me just get , right ?

imgContainer is just a class representing a bitmap. It doesn't let you edit the bitmap. So its width and height are readonly in the IDL.

What do you mean by "its DOM value :s"?

I meant length (height || width)

That doesn't really answer my question. I can think of at least 5 different things you could mean here (computed style, specified style, HTML attribute, DOM property, boxObject properties). Which one are you talking about?

So, no matter changes on the height or width of a image in the DOM Tree, imgContainer will always get me original dimensions of an image. Is it what you mean ?

That's correct. Since you were using imgContainer, I assumed that was what you wanted. If you want the current dimensions, just use .width and .height on the image (see nsIDOMHTMLImageElement).

I'm just trying to found out the fastest way to zooming images (target is an embedded device, so I must to be careful)

I realize you're zooming images. What I don't understand is whether you're zooming from the intrinsic size or the current size. Your code looks like the code for zooming from intrinsic size, but then you're complaining that it's zooming from intrinsic size...

-Boris
_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout

Reply via email to