[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to display an image contained in a file?
From: |
Eli Zaretskii |
Subject: |
Re: How to display an image contained in a file? |
Date: |
Tue, 01 Mar 2016 21:04:48 +0200 |
> From: Marcin Borkowski <mbork@mbork.pl>
> Date: Tue, 01 Mar 2016 19:38:44 +0100
>
> I have an image in the file, say "~/image.png". I want to display it in
> an interactive function - say, the user says M-x display-my-image, and
> I want a buffer containing the image to pop up. What do I do? Of
> course, (find-file "~/image.png") works, but it's probably not what
> I should do in an Elisp program, right?
(let ((image (create-image "~/image.png")))
(pop-to-buffer "*image*")
(insert-image image))