Difference between revisions of "D2w"

From Sega Retro

(Created page with "<includeonly>{{#ifexpr: {{{3}}} < {{w2h|{{{1}}}|{{{2}}}}} | {{h2w|{{{1}}}|{{{3}}}}} | {{{2}}} }}</includeonly><noinclude> This template obtains the width of a resized image, g...")
 
m (Text replacement - "[[Category:Sega Retro templates" to "[[Category:Templates")
 
(One intermediate revision by one other user not shown)
Line 6: Line 6:
  
 
==Usage==
 
==Usage==
<tt><nowiki>{{d2w|Imagefilename.png|width|height}}</nowiki></tt>
+
<tt><nowiki>{{</nowiki>d2w|Imagefilename.png|{{green|'''width'''}}|{{red|'''height'''}}}}</tt>
 +
 
 +
<tt>{{green|'''width'''}}</tt> and <tt>{{red|'''height'''}}</tt> correspond to the dimensions of an embedded image:
 +
 
 +
<tt><nowiki>[[</nowiki>Imagefilename.png|{{green|'''100'''}}x{{red|'''200'''}}px]]</tt>
  
 
==Example==
 
==Example==
Line 15: Line 19:
 
<tt><nowiki>{{d2w|GoldenAxe Title.png|160|1000}}</nowiki></tt> returns '''{{d2w|GoldenAxe Title.png|160|1000}}'''
 
<tt><nowiki>{{d2w|GoldenAxe Title.png|160|1000}}</nowiki></tt> returns '''{{d2w|GoldenAxe Title.png|160|1000}}'''
  
[[Category:Sega Retro templates|{{PAGENAME}}]]</noinclude>
+
[[Category:Templates|{{PAGENAME}}]]</noinclude>

Latest revision as of 23:48, 24 June 2023

This template obtains the width of a resized image, given that its dimensions are defined.

Usage

{{d2w|Imagefilename.png|width|height}}

width and height correspond to the dimensions of an embedded image:

[[Imagefilename.png|100x200px]]

Example

{{d2w|GoldenAxe Title.png|320|224}} returns 320

{{d2w|GoldenAxe Title.png|1000|112}} returns 160

{{d2w|GoldenAxe Title.png|160|1000}} returns 160