Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

XUL, image & buffer

27 views
Skip to first unread message

cyril

unread,
Oct 8, 2006, 1:39:19 PM10/8/06
to
Hi,

I currently try to show images in a xulrunner application.
I can use <html:image>, <xul:image> or a plugin.

I would like to show a lot of images in a short time to simulate an
animation.

I 'd like to interact with the images : zoom (draw a rectangle), move.

As far as I know, I is not possible to controle <xul:image> at the
buffer level, even with XPCOM.
And a plugin is more difficult to write, to maintain (win32, Unix...).

Is it possible to do what I'd like to do without a plugin ?
Why there isn't an image object which can be controled from XPCOM ? Is
there any plan ?

I think I would be a good thing for the graphical applications world ?

Thanks a lot,

Cyril.

Nickolay Ponomarev

unread,
Oct 8, 2006, 3:59:36 PM10/8/06
to cyril, dev-te...@lists.mozilla.org
On 8 Oct 2006 10:39:19 -0700, cyril <cyril.g...@gmail.com> wrote:
> Hi,
>
> I currently try to show images in a xulrunner application.
> I can use <html:image>, <xul:image> or a plugin.
>
> I would like to show a lot of images in a short time to simulate an
> animation.
>
> I 'd like to interact with the images : zoom (draw a rectangle), move.
> [..]

> Why there isn't an image object which can be controled from XPCOM ? Is
> there any plan ?

There's <html:canvas>:
http://developer.mozilla.org/en/docs/Category:HTML:Canvas

Nickolay

cyril

unread,
Oct 8, 2006, 4:53:57 PM10/8/06
to

Yes I know, but <html:canvas> use the same rules concerning the load
and the update of images as <xtml:image>.
And you can't update images at the speed you would like...Even if they
are available.

Some weeks ago, I did some tests and I could show only 2 images a
second in average.

Cyril.

Nickolay Ponomarev

unread,
Oct 8, 2006, 6:11:59 PM10/8/06
to cyril, dev-te...@lists.mozilla.org
You won't be able to do per-pixel manipulations in JS at high speed.
You'll need to write a plugin in C++. I'd expect drawing other images
to be fast though.

Nickolay

cyril

unread,
Oct 8, 2006, 6:18:10 PM10/8/06
to

> You won't be able to do per-pixel manipulations in JS at high speed.
> You'll need to write a plugin in C++. I'd expect drawing other images
> to be fast though.

I agree with you.
But imagine you have the images in a local directory.

How would you do to draw these at top speed in mozilla (animation) ?

Cyril.

Nickolay Ponomarev

unread,
Oct 8, 2006, 7:34:44 PM10/8/06
to cyril, dev-te...@lists.mozilla.org
You could try creating a few image elements and showing them in sequence.

Nickolay

Tei

unread,
Oct 9, 2006, 7:22:26 AM10/9/06
to dev-te...@lists.mozilla.org
On 8 Oct 2006 13:53:57 -0700, cyril <cyril.g...@gmail.com> wrote:

This raise questions.

Whats about <image/> native xul tag?
Whats about to replace images with css and speed?
Whats about to replace images with "data:image/gif,..." protocol?

Why you need animations? For most uses you can do stuff with GIF
native animation, etc.

Complex stuff can be rendered on the server and downloaded as a png or
something.

cyril

unread,
Oct 9, 2006, 11:39:31 AM10/9/06
to

> Whats about <image/> native xul tag?
xul:image = xhtml:image, no ?

> Whats about to replace images with css and speed?
> Whats about to replace images with "data:image/gif,..." protocol?

I tried, and I think gecko decides itself when to update the image.


> Why you need animations? For most uses you can do stuff with GIF
> native animation, etc.
>
> Complex stuff can be rendered on the server and downloaded as a png or
> something.

It 's not a web application.
In fact, images are build in the background (scientific application)
and i'd like to draw them at high speed (wave propagation for
instance).

Cyril.

Tei

unread,
Oct 9, 2006, 12:42:41 PM10/9/06
to dev-te...@lists.mozilla.org
On 9 Oct 2006 08:39:31 -0700, cyril <cyril.g...@gmail.com> wrote:
>
> > Whats about <image/> native xul tag?
> xul:image = xhtml:image, no ?
>

No idea.

> > Whats about to replace images with css and speed?
> > Whats about to replace images with "data:image/gif,..." protocol?
>
> I tried, and I think gecko decides itself when to update the image.
>

Ok.

>
> > Why you need animations? For most uses you can do stuff with GIF
> > native animation, etc.
> >
> > Complex stuff can be rendered on the server and downloaded as a png or
> > something.
> It 's not a web application.
> In fact, images are build in the background (scientific application)
> and i'd like to draw them at high speed (wave propagation for
> instance).

Humm... Idea!

As other people state. Javascript is slow, so a pixel approach will be
doomed. Maybe you can draw lines, etc with a SVG canvas? Firefox 1.5+
support svg, I think. That is better and faster than perpixel
drawing.
Even game engines nowdays work that way, with texels and not pixels.
Is faster to let the hardware render textures/lines/etc than try to
compute yourself.

cyril

unread,
Oct 9, 2006, 2:29:44 PM10/9/06
to

> As other people state. Javascript is slow, so a pixel approach will be
> doomed. Maybe you can draw lines, etc with a SVG canvas? Firefox 1.5+
> support svg, I think. That is better and faster than perpixel
> drawing.

Why not ?

But images do already exist in memory.
I thought simply of a guinuine XPCOM FrameBuffer.

I think there is no solution without a plugin :-(

Cyril.

0 new messages