Կաղապար:Annotated image/doc
Ուշադրություն։ Կաղապարը պարունակում է չթարգմանված բաժիններ կամ հատվածներ։ Ոչ հայերեն հատված(ներ)ը անհրաժեշտ է թարգմանել կամ հեռացնել, հակառակ դեպքում հոդվածը կամ տվյալ բաժինը ենթակա է ջնջման։ |
This template allows the addition of explanatory notes to images in the form of actual text (which can also contain links), which is usually more legible than text built into the image – especially if the image is reduced to thumbnail size.
Other uses include cropping an image to exclude unimportant parts and perhaps enlarge important parts, and internationalisation, as the annotations can be changed without changing the image.
Օգտագործման ձևը
[խմբագրել կոդը]Կտրելու օրինակ
[խմբագրել կոդը]You have an image like commons:File:Mona Lisa color restoration2.jpg. But you want to show only a part of the image, say a part of the nose and mouth:
![](http://178.128.105.246/cars-http-upload.wikimedia.org/wikipedia/commons/f/f0/Mona_Lisa_color_restoration2.jpg)
![](http://178.128.105.246/cars-http-upload.wikimedia.org/wikipedia/commons/thumb/0/04/Monalisa.svg/300px-Monalisa.svg.png)
You can do it with following code:
{{Annotated image | 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= <!-- this parameter must be there, empty or not, it must be there! --> | caption = Cropped Mona Lisa from a 2000 pixel image }}
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:
Պատկերների բացատրական նշումների օրինակներ
[խմբագրել կոդը]For more examples see Կաղապար:Annotated image/doc/Samples.
Parameters
[խմբագրել կոդը]All parameters have names – there are no nameless "numbered" parameters.
Two of the parameters, image and imagemap, are mutually exclusive – use one of them but not both.
In most cases you will need only the required parameters – the rest are there in case you want additional formatting options.
Name | Allowed values | Default value | Function & notes |
---|---|---|---|
caption | wikitext | (required) | Caption of the image, goes in the usual place for image captions. |
alt | text | empty | Alt text of image, for readers who cannot see it; see WP:ALT. |
image | valid image file name; SVG images are allowed | (see note) | You must specify image or imagemap but not both. |
imagemap | valid (X)HTML imagemap | (see note) | You must specify image or imagemap but not both. |
width | positive integer | (optional) | 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 you can set by using image-width). |
height | positive integer | (optional) | 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 you change the displayed width of the image by specifying image-width, you will have to work out the image's displayed height and then add any "margins" you need for annotations. |
image-left | integer | (optional; defaults to 0) | 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 | (optional; defaults to 0) | 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 | (required) | Width of the image (in pixels). |
annotations | required | may be left empty (annotations=) if you simply want to crop an image | Annotations for the image. |
float | right left none |
right | Makes the template's output float to the right or left of the text.. |
outer-css | any valid CSS | (optional, no default value) | Additional CSS for the outermost box. Cannot over-ride any other parameters that you specify for the outer box. It is best to use this only as a last resort. |
image-bg-color | any valid CSS color | white | Background of the box in which the image is displayed. You might want to set a dark background if the image is dark and you want to use a light color for the annotations. |
image-css | any valid CSS | (optional, no default value) | Additional CSS for the image (or rather, the invisible box that contains it). Cannot over-ride any other parameters that you specify for the image's box. It is best to use this only as a last resort. |
annot-text-align | left right center |
left | Sets a default text-alignment for all the contained annotations. You can over-ride this for individual annotations if you wish. |
annot-background-color | any valid CSS color | transparent | Sets a default background-color for all the contained annotations. You can over-ride this for individual annotations if you wish. |
annot-font-family | any valid CSS font-family | (optional, no default value) | Sets a default font-family for all the contained annotations. You can over-ride this for individual annotations if you wish. |
annot-font-size | positive integer | (optional, no default value) | Sets a default font-size (in pixels) for all the contained annotations. You can over-ride this for individual annotations if you wish. |
annot-font-weight | any valid CSS font-weight | (optional, no default value) | Sets a default font-weight for all the contained annotations. You can over-ride this for individual annotations if you wish. |
annot-font-style | any valid CSS font-style (e.g. italic) | (optional, no default value) | Sets a default font-style for all the contained annotations. You can over-ride this for individual annotations if you wish. |
annot-line-height | any valid CSS line-height | (optional, no default value) | Sets a default line-height (line spacing) for all the contained annotations. You can over-ride this for individual annotations if you wish. Only useful for multi-line annotations. |
annot-color | any valid CSS color | (optional, no default value) | Sets a default color for all the contained annotations. You can over-ride this for individual annotations if you wish. |
Օրինակ
[խմբագրել կոդը]Կաղապար:Annotated image/Extinction
Internationalisation
[խմբագրել կոդը]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 Կաղապար:Annotated image/Extinction, is widely used..
Pitfall
[խմբագրել կոդը]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.
Subpages: templates based on this one
[խմբագրել կոդը]This list is automatically generated and updated. Redirects are shown in italics.
Տես նաև
[խմբագրել կոդը]- Կաղապար:Annotation, for creating the annotations
- Կաղապար:Annotated image 4, for annotating left/right/center-aligned images with a normal caption background color
- Կաղապար:Image label, an alternative
- Կաղապար:Overlay, labels the image, automatically constructs a column balanced legend, with sub legends if desired, wikilinks image labels and legend items if desired, allows separate control of label pop up tip, assists in label coordinates determination, etc.
- Կաղապար:Location map+, for maps with "pins"
- Կաղապար:Superimpose, superimposes images