/usr/share/mozart/doc/wp/node12.html is in mozart-doc 1.4.0-8ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>3.6 Images</TITLE><LINK href="ozdoc.css" rel="stylesheet" type="text/css"></HEAD><BODY><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node11.html#section.widgets-1.label"><< Prev</A></TD><TD><A href="node6.html">- Up -</A></TD><TD><A href="node13.html#section.widgets-1.messages">Next >></A></TD></TR></TABLE><DIV id="section.widgets-1.images"><H2><A name="section.widgets-1.images">3.6 Images</A></H2><P> <A name="label115"></A>Besides of text and bitmaps labels can display images. Images differ from bitmaps in that they allow for more than two colors to be displayed. </P><P> Images are provided as objects in Oz. These objects are also tickle objects (see <A href="node8.html#section.widgets-1.tickles">Section 3.2</A>), but are different from widget objects. </P><P> </P><DIV id="figure.widgets-1.images"><HR><P><A name="figure.widgets-1.images"></A></P><P> </P><DIV align="center"><IMG alt="" src="images-1.gif"></DIV><P> <A name="label117"></A> </P><DL class="anonymous"><DD class="code"><CODE>D =<SPAN class="string">'/usr/share/mozart/doc/wp/'</SPAN> <BR>I ={New Tk<SPAN class="keyword">.</SPAN>image tkInit(type:photo format:ppm file:D<SPAN class="keyword">#</SPAN><SPAN class="string">'truck-left.ppm'</SPAN>)}<BR>L1={New Tk<SPAN class="keyword">.</SPAN>label tkInit(parent:W image:I)}<BR>L2={New Tk<SPAN class="keyword">.</SPAN>label tkInit(parent:W image:I)}<BR>L3={New Tk<SPAN class="keyword">.</SPAN>label tkInit(parent:W image:I)}<BR>{Tk<SPAN class="keyword">.</SPAN>send pack(L1 L2 L3 padx:1<SPAN class="keyword">#</SPAN>m pady:1<SPAN class="keyword">#</SPAN>m side:left)}</CODE></DD></DL><P> </P><P class="caption"><STRONG>Figure 3.6:</STRONG> Three labels displaying the same image.</P><HR></DIV><P> </P><P> The program in <A href="node12.html#figure.widgets-1.images">Figure 3.6</A> creates an image object and displays the image in three labels. Changing the configuration of the image, changes the displayed image in all label widgets. For example, feeding the following expression </P><DL class="anonymous"><DD class="code"><CODE>{I tk(configure file:D<SPAN class="keyword">#</SPAN><SPAN class="string">'truck-right.ppm'</SPAN>)}</CODE></DD></DL><P> replaces all three displayed trucks by trucks heading in the inverse direction. </P><DIV class="apropos"><P class="margin">type and format</P><P> <A name="label118"></A><A name="label119"></A><A name="label120"></A><A name="label121"></A><A name="label122"></A><A name="label123"></A> Images can be of two different types. The value of the <CODE>type</CODE> configuration option can be <CODE>photo</CODE> (as in our example), or <CODE>bitmap</CODE>. If the type is <CODE>photo</CODE>, the image can display files in two different formats. The format is specified by the <CODE>format</CODE> option. Valid values for the <CODE>format</CODE> option are <CODE>gif</CODE> and <CODE>ppm</CODE>. </P></DIV><DIV class="apropos"><P class="margin">bitmap images</P><P> <A name="label124"></A> In case the value for the <CODE>type</CODE> option is <CODE>bitmap</CODE>, the value given for the <CODE>file</CODE> option must be a valid bitmap file. </P></DIV><DIV class="apropos"><P class="margin">referring to images by URLs</P><P> <A name="label125"></A> In addition to files, images can also be referred to by URLs. For example, </P><BLOCKQUOTE class="code"><CODE>{New Tk<SPAN class="keyword">.</SPAN>image tkInit(type:photo format:gif<BR> url:<SPAN class="string">'http://foo.com/bar.gif'</SPAN>}</CODE></BLOCKQUOTE><P> would have loaded a gif file from the given URL. Note that the graphics engine itself is not capable of handling URLs. Instead, the image object handles URLs by localizing a URL to a local file (see also <A href="../system/node50.html#chapter.resolve">Chapter 15 of ``System Modules''</A>). The local file then is used by the graphics engine. </P></DIV><P> In <A href="node45.html#section.tools.images">Section 8.4</A> an abstraction is presented that eases the handling of images considerably. </P><P> Reference information on images can be found in <A href="../tcltk/TkCmd/image.htm"><KBD>image</KBD></A>. </P></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node11.html#section.widgets-1.label"><< Prev</A></TD><TD><A href="node6.html">- Up -</A></TD><TD><A href="node13.html#section.widgets-1.messages">Next >></A></TD></TR></TABLE><HR><ADDRESS><A href="http://www.ps.uni-sb.de/~schulte/">Christian Schulte</A><BR><SPAN class="version">Version 1.4.0 (20110908185330)</SPAN></ADDRESS></BODY></HTML>
|