Actions

Template

Difference between revisions of "Cropimage"

From Sonic Retro

(Created page with "<includeonly>{{#if:{{{scale|}}}|{{#vardefine:scale|{{{scale}}}}}|{{#vardefine:scale|1}}}}<div style=" {{#if: {{{float|}}} | float:{{{float}}}; |}} display:inline-block; overfl...")
 
Line 12: Line 12:
 
width:{{#expr:{{#mediawidth:{{{image|}}}}}*{{#var:scale}}}}px;
 
width:{{#expr:{{#mediawidth:{{{image|}}}}}*{{#var:scale}}}}px;
 
height:{{#expr:{{#mediaheight:{{{image|}}}}}*{{#var:scale}}}}px;
 
height:{{#expr:{{#mediaheight:{{{image|}}}}}*{{#var:scale}}}}px;
line-height:0px">{{#if: {{{image|}}} |{{scaleimage|{{{image}}}|{{#var:scale}}|nolink=true}}|No image to display.}}</div></div></includeonly><noinclude>
+
line-height:0px">{{#if: {{{image|}}} |{{scaleimage|{{{image}}}|{{#var:scale}}|nolink={{{nolink|}}}}}|No image to display.}}</div></div></includeonly><noinclude>
 
This template will display part of an image.
 
This template will display part of an image.
  

Revision as of 14:58, 9 January 2021

This template will display part of an image.

Usage

{{cropimage
| image=
| width=
| height=
| x=
| y=
| float=
| scale=
| sprite=
}}
  • All parameters are optional except "image".
  • "width" and "height" refer to the crop area (the area of the image which remains visible), not the size of the image itself. The image is not resized.
  • "x" and "y" are distances from the left and top edges of the image where the visible area begins.
  • "float" can be left or right.
  • "scale" enlarges or shrinks the image by that factor (i.e. 2 will double the image size).
  • "sprite=yes" disables filtering.