@@ -162,41 +162,47 @@ The optional third argument to **loadImage()** is a map of options:
162162* ** minHeight** : Defines the minimum height of the img/canvas element.
163163* ** sourceWidth** : The width of the sub-rectangle of the source image to draw
164164into the destination canvas.
165- Defaults to the source image width and requires * canvas: true* .
165+ Defaults to the source image width and requires ` canvas: true ` .
166166* ** sourceHeight** : The height of the sub-rectangle of the source image to draw
167167into the destination canvas.
168- Defaults to the source image height and requires * canvas: true* .
168+ Defaults to the source image height and requires ` canvas: true ` .
169169* ** top** : The top margin of the sub-rectangle of the source image.
170- Defaults to * 0 * and requires * canvas: true* .
170+ Defaults to ` 0 ` and requires ` canvas: true ` .
171171* ** right** : The right margin of the sub-rectangle of the source image.
172- Defaults to * 0 * and requires * canvas: true* .
172+ Defaults to ` 0 ` and requires ` canvas: true ` .
173173* ** bottom** : The bottom margin of the sub-rectangle of the source image.
174- Defaults to * 0 * and requires * canvas: true* .
174+ Defaults to ` 0 ` and requires ` canvas: true ` .
175175* ** left** : The left margin of the sub-rectangle of the source image.
176- Defaults to * 0 * and requires * canvas: true* .
176+ Defaults to ` 0 ` and requires ` canvas: true ` .
177177* ** contain** : Scales the image up/down to contain it in the max dimensions if
178- set to * true* .
178+ set to ` true ` .
179179This emulates the CSS feature
180180[ background-image: contain] ( https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Scaling_background_images#contain ) .
181- * ** cover** : Scales the image up/down to cover the max dimensions with the image dimensions if set to * true* .
181+ * ** cover** : Scales the image up/down to cover the max dimensions with the image
182+ dimensions if set to ` true ` .
182183This emulates the CSS feature
183184[ background-image: cover] ( https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Scaling_background_images#cover ) .
184185* ** aspectRatio** : Crops the image to the given aspect ratio (e.g. ` 16/9 ` ).
185- This feature assumes * crop: true* .
186+ Setting the ` aspectRatio ` also enables the ` crop ` option.
187+ * ** pixelRatio** : Defines the ratio of the canvas pixels to the physical image
188+ pixels on the screen.
189+ Should be set to ` window.devicePixelRatio ` unless the scaled image is not
190+ rendered on screen.
191+ Requires ` canvas: true ` .
186192* ** crop** : Crops the image to the maxWidth/maxHeight constraints if set to
187- * true* .
188- This feature assumes * canvas: true * .
193+ ` true ` .
194+ Enabling the ` crop ` option also enables the ` canvas ` option .
189195* ** orientation** : Allows to transform the canvas coordinates according to the
190196EXIF orientation specification.
191- This feature assumes * canvas: true * .
197+ Setting the ` orientation ` also enables the ` canvas ` option .
192198* ** canvas** : Returns the image as
193- [ canvas] ( https://developer.mozilla.org/en/HTML/Canvas ) element if set to * true* .
199+ [ canvas] ( https://developer.mozilla.org/en/HTML/Canvas ) element if set to ` true ` .
194200* ** crossOrigin** : Sets the crossOrigin property on the img element for loading
195201[ CORS enabled images] ( https://developer.mozilla.org/en-US/docs/HTML/CORS_Enabled_Image ) .
196202* ** noRevoke** : By default, the
197203[ created object URL] ( https://developer.mozilla.org/en/DOM/window.URL.createObjectURL )
198204is revoked after the image has been loaded, except when this option is set to
199- * true* .
205+ ` true ` .
200206
201207They can be used the following way:
202208
0 commit comments