You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -108,24 +108,26 @@ Note since UIImageView/NSImageView support this vector rendering, it means this
108
108
109
109
### Render SVG as bitmap image
110
110
111
-
In most cases, vector SVG is preferred. But however, sometimes you may want the bitmap form of SVG, used for image processing. You can use `.svgPrefersBitmap` to provide the bitmap format as well.
111
+
In most cases, vector SVG is preferred. But however, sometimes you may want the bitmap form of SVG, used for image processing.
112
112
113
-
By default it use the SVG canvas size. You can also specify a desired size during image loading using `.svgImageSize` context option. And you can specify whether or not to keep aspect ratio during scale using `.svgImagePreserveAspectRatio` context option.
113
+
By default it use the SVG viewBox size. You can also specify a desired size during image loading using `.imageThumbnailPixelSize` context option. And you can specify whether or not to keep aspect ratio during scale using `.imagePreserveAspectRatio` context option.
114
+
115
+
Note: Once you pass the pixel size, we will always generate the bitmap representation even on iOS/tvOS 11+. If you want the vector format, do not pass them, let `UIImageView` to dynamically stretch the SVG.
Copy file name to clipboardExpand all lines: SDWebImageSVGCoder/Classes/SDWebImageSVGCoderDefine.h
+5-4Lines changed: 5 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -14,17 +14,18 @@
14
14
/**
15
15
A BOOL value which specify whether we prefer the actual bitmap representation instead of vector representation for SVG image. This is because the UIImage on iOS 13+ (NSImage on macOS 10.15+) can use the vector image format, which support dynamic scale without losing any detail. However, for some image processing logic, user may need the actual bitmap representation to manage pixels. (NSNumber)
16
16
If you don't provide this value, use NO for default value and prefer the vector format when possible.
17
+
@note Deprecated, use `SDWebImageContextImageThumbnailPixelSize`. Pass CGSize.zero means the viewBox size of SVG.
A CGSize raw value which specify the desired SVG image size during image loading. Because vector image like SVG format, may not contains a fixed size, or you want to get a larger size bitmap representation UIImage. (NSValue)
22
-
If you don't provide this value, use viewBox size of SVG for default value;
23
+
If you don't provide this value, use viewBox size of SVG for default value.
A BOOL value which specify the whether SVG image should keep aspect ratio during image loading. Because when you specify image size via `SDWebImageContextSVGImageSize`, we need to know whether to keep aspect ratio or not when image size aspect ratio is not equal to SVG viewBox size aspect ratio. (NSNumber)
28
29
If you don't provide this value, use YES for default value.
0 commit comments