Gnus development mailing list
 help / color / mirror / Atom feed
* image instance/specifier/instantiator
@ 1998-11-21  6:06 Lars Magne Ingebrigtsen
  1998-11-22 13:09 ` Hrvoje Niksic
  0 siblings, 1 reply; 5+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-11-21  6:06 UTC (permalink / raw)


I'm misunderstanding something.

To make an image specifier I do this:

      (make-image-specifier
       (vector (intern type) :data (buffer-string)))

This works, and I use this to make an annotation that I insert.

However, I would like to know the height and width of the image,
before I decide whether to display it inline out externally.  I can't
use annotations for that, since we only have annotation-width, but not 
annotation-height.  However, we have image-instance-width, so I though 
I could just instatiate an image, but `make-image-instance' called
with an image specifier doesn't work.  It needs, uh, something else.
But what?  I have no idea.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@ifi.uio.no * Lars Magne Ingebrigtsen


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: image instance/specifier/instantiator
  1998-11-21  6:06 image instance/specifier/instantiator Lars Magne Ingebrigtsen
@ 1998-11-22 13:09 ` Hrvoje Niksic
  1998-11-24  9:36   ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: Hrvoje Niksic @ 1998-11-22 13:09 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@ifi.uio.no> writes:

> However, I would like to know the height and width of the image,
> before I decide whether to display it inline out externally.  I
> can't use annotations for that, since we only have annotation-width,
> but not annotation-height.

That's quite strange.  Anyway, if I were you, I'd try with
(glyph-width (annotation-glyph ...)) and
(glyph-height (annotation-glyph ...)).

BTW, why do you create image specifiers at all?  I don't think you
need to do that -- an instantiator should suffice.

-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
The end of the world is coming...  SAVE YOUR BUFFERS!


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: image instance/specifier/instantiator
  1998-11-22 13:09 ` Hrvoje Niksic
@ 1998-11-24  9:36   ` Lars Magne Ingebrigtsen
  1998-11-24 11:46     ` Hrvoje Niksic
  0 siblings, 1 reply; 5+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-11-24  9:36 UTC (permalink / raw)


Hrvoje Niksic <hniksic@srce.hr> writes:

> That's quite strange.  Anyway, if I were you, I'd try with
> (glyph-width (annotation-glyph ...)) and
> (glyph-height (annotation-glyph ...)).

Thanks; this does the trick.

> BTW, why do you create image specifiers at all?  I don't think you
> need to do that -- an instantiator should suffice.

Er...  I though

      (make-image-specifier
       (vector (intern type) :data (buffer-string)))

was the simplest way to create an image?  This can later be fed to
`make-annotation' for insertion into the buffer...

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: image instance/specifier/instantiator
  1998-11-24  9:36   ` Lars Magne Ingebrigtsen
@ 1998-11-24 11:46     ` Hrvoje Niksic
  1998-11-24 19:57       ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: Hrvoje Niksic @ 1998-11-24 11:46 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> > BTW, why do you create image specifiers at all?  I don't think you
> > need to do that -- an instantiator should suffice.
> 
> Er...  I though
> 
>       (make-image-specifier
>        (vector (intern type) :data (buffer-string)))
> 
> was the simplest way to create an image?

Well, it creates an image specifier, which contains information how
the image should be displayed on various devices.  In XEmacs parlance,
the actual image in buffer is in called a "glyph", and the easiest way
to create it is using an instantiator, without mucking with image
specifiers at all (leave that to the internal code.)  For instance:

;; I like backquotes
(setq my-glyph (make-glyph `[,(intern type) :data ,(buffer-string)]))

Now, you can attach `my-glyph' at the beginning or an end of an extent
(this is considered "low-level"), or feed it to `make-annotation'.
The specifier will, of course, still be there:

(glyph-image my-glyph)
  => #<image-specifier global=((x) . [gif :file "/home/srce/hniksic/pics/kreten.gif" :data "GIF87a..."]>

XEmacs' interface to images may be a bit confusing at first; if you
don't understand how it works, feel free to ask.  Also, I've found
that chapter in the manual quite well written (but that's me.)

-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
You're never alone with schizophrenia.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: image instance/specifier/instantiator
  1998-11-24 11:46     ` Hrvoje Niksic
@ 1998-11-24 19:57       ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 5+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-11-24 19:57 UTC (permalink / raw)


Hrvoje Niksic <hniksic@srce.hr> writes:

> Well, it creates an image specifier, which contains information how
> the image should be displayed on various devices.  In XEmacs parlance,
> the actual image in buffer is in called a "glyph", and the easiest way
> to create it is using an instantiator, without mucking with image
> specifiers at all (leave that to the internal code.)  For instance:
> 
> ;; I like backquotes
> (setq my-glyph (make-glyph `[,(intern type) :data ,(buffer-string)]))

Ah, right.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1998-11-24 19:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-11-21  6:06 image instance/specifier/instantiator Lars Magne Ingebrigtsen
1998-11-22 13:09 ` Hrvoje Niksic
1998-11-24  9:36   ` Lars Magne Ingebrigtsen
1998-11-24 11:46     ` Hrvoje Niksic
1998-11-24 19:57       ` Lars Magne Ingebrigtsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).