Predloga:Anotirana slika

Iz Wikipedije, proste enciklopedije
Jump to navigation Jump to search
Documentation icon Dokumentacija predloge[predogled] [uredi] [zgodovina] [osveži]

Ta predloga dovoljuje dodajanje razlagalnih opomb v slike v obliki besedila (ki lahko vsebuje tudi wikipovezave).

Uporabljate lahko tudi izrezovanje slike ali pa povečevanje določenih delov.

Ta predloga in {{anotirana slika 4}}, sta edini predlogi za anotirane slike, ki izkoriščata predlogo {{anotacija}} za superponiranje wikibesedila v slike.

Sintaksa[uredi kodo]

{{Anotirana slika
| image = 
| image-width = 
| image-left = 
| image-top = 
| width = 
| height = 
| float = 
| annotations = 
| caption = 
}}

Parametri[uredi kodo]

All parameters have names; there are no nameless "numbered" parameters.

Two of the parameters, image and imagemap, are mutually exclusive: use one of them, not both.

In the following list, those parameters required by the template are shown in bold italics.

Parameter  Allowed values  Default value  Function / Notes 
caption wikitext Caption accompanying image.
alt text empty Alt text for people whose vision of the image is impaired (see WP:ALT).
either  image
or  imagemap
valid image filenamea or
valid X/HTML imagemap
Specify either image or imagemap, but not both.
width positive integer Total width (in pixels) of the box containing the image and annotations. Must be at least as large as the image's displayed width (which can be set using image-width).
height positive integer Total height (in pixels) of the box containing the image and annotations. Must be at least as large as the image's displayed height. If the displayed width of the image is changed by specifying image-width, the image's displayed height and any additional "margins" for annotations will need to be calculated.
image-left integer (zero) X-coordinate of the image's top left corner (in pixels), relative to the top left corner of the box containing the image and annotations. Negative values crop the image.
image-top integer (zero) Y-coordinate of the image's top left corner (in pixels), relative to the top left corner of the box containing the image and annotations. Negative values crop the image.
image-width positive integer Width of the image (in pixels).
annotations Annotations for the image. May be left empty (i.e. |... |annotations= |...) to crop an image only.
float
  • right
  • left
  • none
right To specify whether or not the template floats to the right or left of adjacent content.
outer-css any valid CSS Additional CSS applied to the outermost box. Does not override any other parameters specified for the outer box (i.e. best used only as "a last resort").
image-bg-color any valid CSS color white Background of the box in which the image is displayed. For example, a dark background for a relatively dark image on which relatively lightly colored annotations are placed.
image-css any valid CSS Additional CSS applied to the (inner box carrying the) image. Does not override any other parameters specified for this box (i.e. best used only as "a last resort").
annot-text-align
  • left
  • right
  • center
left Sets a default text-alignment for all the contained annotations. Can be overridden per annotation.
annot-background-color any valid CSS color transparent Sets a default background-color for all the contained annotations. Can be overridden per annotation.
annot-font-family any valid CSS font-family Sets a default font-family for all the contained annotations. Can be overridden per annotation.
annot-font-size positive integer Sets a default font-size (in pixels) for all the contained annotations. Can be overridden per annotation.
annot-font-weight any valid CSS font-weight Sets a default font-weight for all the contained annotations. Can be overridden per annotation.
annot-font-style any valid CSS font-style Sets a default font-style (e.g. "italic") for all the contained annotations. Can be overridden per annotation.
annot-line-height any valid CSS line-height Sets a default line-height (line spacing) for all the contained annotations. Can be overridden per annotation.
annot-color any valid CSS color Sets a default color for all the contained annotations. Can be overridden per annotation.
a SVG images allowed.

Internationalisation[uredi kodo]

This template makes internationalisation easy; the text is already separate from the image, so it is easy to translate the text and, if necessary, move pieces of text, as the lengths of the same text in different languages can vary a lot. For example, nl:Sjabloon:Zijbalk mariene extincties, the Dutch version of Predloga:Anotirana slika/Izumrtje, is widely used.

Pitfall[uredi kodo]

There is one pitfall, although it is mainly about using one browser in the correct way (Microsoft Internet Explorer, of course). Internet Explorer has two ways of scaling-up text to ease readability:

  • Text resizing, which appears in Internet Explorer's View menu, affects text but not images. This method can disrupt annotated images, as the text is scaled up but the image content and frame are not. Firefox and Opera do not use this mechanism.
  • Zoom also scales the image as well as text annotations, and thus does not disrupt the relative sizes and locations of annotations in annotated images. Netscape and its Mozilla derivatives, Firefox and Opera have had zoom for years, and it is more useful, as it also scales text implemented as part of an image, e.g., as in the Wikipedia logo. The zoom control sequences (CTRL + to increase, CTRL - to decrease) are the same in Firefox, Opera and Internet Explorer. In Firefox and Opera, there also menu items for zoom, which show the control sequences. In Internet Explorer 7 only text resizing appears in the menu; in order to learn zoom, users must look up some external source.

Zgledi[uredi kodo]

Predloga:Anotirana slika/Izumrtje

Dodajanje razlagalnih napisov[uredi kodo]

glej Prdloga:Anotirana slika/dok/Primeri.

Izrezovanje (cropping)[uredi kodo]

Na voljo imate sliko kot je commons:File:Mona Lisa color restoration2.jpg. Prikazati pa hočete le del slike, npr. usta in nos:

Ta slika je široka 300 px (kakršna je tudi shranje v Zbirki), ampak to je nepomembno za uporabo v tej predlogi.
Vse mere, ki se nanašajo na image-width (the virtual width you have given to the image (in the example: 2000px))

You can do it with following code:

{{Anotirana slika
| image = Mona Lisa color restoration2.jpg
| image-width = 2000  <!-- choose any width, as you like it. It doesn't matter the factual width of the image-->
| image-left = -850   <!-- crop the left part. Be aware of the "-" minus symbol  --> 
| image-top = -800    <!-- crop the upper part. Be aware of the "-" minus symbol  -->
| width =  250        <!-- crop the right part. That will be the width of the image in the article -->
| height =  250       <!-- crop the below part. That will be the height of the image in the article -->
| float = left
| annotations =       <!-- empty or not, this parameter must be included must be included -->
| caption = Izrezana Mona Lisa iz 2000 px slike
}}

The result is a 250pixels x 250pixels area from the 2000 pixels width image (the factual width of the image doesn't matter). The upper 800 pixels and the 850 pixels at the left side of the 2000-image are "discarded" as well as the "rest" at the right side after the 250 pixels and at the bottom after the 250 pixels:

Izrezana Mona Lisa iz 2000 px slike

Podstrani (predloge, ki temeljijo na tej predlogi)[uredi kodo]

Ta seznam se generira in osvežuje avtomatsko. preusmeritev so prikazane poševno.

Glej tudi[uredi kodo]

  • {{Anotacija}}, for creating annotations.
  • {{Anotirana slika 4}}, for annotating left/right/center-aligned images with a normal caption background color.
  • {{Označba slike}}, an alternative to this template.
  • {{Overlay}}, which labels an image, automatically constructs a column-balanced legend, with, if desired, sub-legends; allows separate control of labels' pop-up tips; assists in determining corordinates for labels' position; etc.
  • {{Lokacijska karta+}}, for maps featuring "pin"-style location icons.
  • {{Superponiraj}} za superponiranje slike na drugo sliko.