ext Boris Zbarsky wrote:

Antônio Gomes wrote:

                        imgContainer->GetHeight(&height);
                        imgContainer->GetWidth(&width);


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). 2) I thought I could use both "get and set size" methods through imgContainer, but it seems to let me just get , right ?


like                  imgContainer->SetHeight(height);
                       imgContainer->SetWidth(width);


// THIS COULD BE THE PROBLEM ... The image size is changed but not its DOM value :s
       img->SetHeight(height);
       img->SetWidth(width);


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

I meant length (height || width)


Ok, I do get them resized at the first time, but if I try resizing again the same web page, when I try to get the new sizes of each images


From the imgContainer? The imgContainer gives you the size of the image encoded in the original GIF/JPEG/whatever file. It does not depend on the width or height of the displayed image. So what you're seeing is exactly what you should be seeing.

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 ?

I'm not sure what you're trying to do, so I'm not sure what to tell you past this point.

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

--Antonio

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

Reply via email to