SCDownloadMediaOptions Class Reference
Inherits from | SCParams : NSObject |
Declared in | SCDownloadMediaOptions.h |
Overview
SCDownloadMediaOptions class contains properties to configure image download.
The options are the same as those for “Dynamic Media Parameters” and “sc:image” XSLT tag.
Tasks
-
width
Width (in pixels)
property
For example : “w=1024” -
height
Height (in pixels)
property
For example : “h=768” -
maxWidth
MaxWidth (pixels)
property
For example : “mw=1920” -
maxHeight
MaxHeight (pixels)
property
For example : “mh=1080” -
language
For example : “la=en”
property -
version
For example : “vs=latest”
property -
database
Sitecore database where media file is stored.
property -
backgroundColor
It accepts both human friendly color names
property
For example : “bc=cyan"
mediaOptions.database = @"cyan”; -
disableMediaCache
Tells the instance to not use the server side cache.
property
Client side cache should be configured using SCApiSession or SCExtendedApiSession class. -
allowStrech
If set to YES, the image will be resized. Otherwise it will be centered. Other space will be filled with the background color.
property
See [SCDownloadMediaOptions backgroundColor] for details. -
scale
Scale factor for image resizing.
property
Set “1” for actual size.
Set “0.25” to reduce the image size to 25% of the original one.
You can also enlarge the image by setting positive values larger than “1” -
displayAsThumbnail
Reduces the image to the thumbnail size if set to YES.
property
Properties
allowStrech
If set to YES, the image will be resized. Otherwise it will be centered. Other space will be filled with the background color.
See [SCDownloadMediaOptions backgroundColor] for details.
@property (nonatomic) BOOL allowStrech
Discussion
If set to YES, the image will be resized. Otherwise it will be centered. Other space will be filled with the background color.
See [SCDownloadMediaOptions backgroundColor] for details.
“as=1” - stretching enabled
“as=0” - stretching disabled
Default value is “NO”
Declared In
SCDownloadMediaOptions.h
backgroundColor
It accepts both human friendly color names
For example : “bc=cyan"
mediaOptions.database = @"cyan”;
@property (nonatomic) NSString *backgroundColor
Discussion
It accepts both human friendly color names
For example : “bc=cyan"
mediaOptions.database = @"cyan”;
It also accepts HTML colors
Hex values are written as 3 double digit numbers, starting with a # sign.
For example : #00FFFF, “bc=%2300FFFF”
mediaOptions.database = @“%2300FFFF”; // cyan
Declared In
SCDownloadMediaOptions.h
database
Sitecore database where media file is stored.
@property (nonatomic) NSString *database
Discussion
Sitecore database where media file is stored.
For example : “db=master”
mediaOptions.database = @“master”;
Declared In
SCDownloadMediaOptions.h
disableMediaCache
Tells the instance to not use the server side cache.
Client side cache should be configured using SCApiSession or SCExtendedApiSession class.
@property (nonatomic) BOOL disableMediaCache
Discussion
Tells the instance to not use the server side cache.
Client side cache should be configured using SCApiSession or SCExtendedApiSession class.
“dmc=1” - server cache disbled
“dmc=0” - server cache enabled
Default value is “NO”
Declared In
SCDownloadMediaOptions.h
displayAsThumbnail
Reduces the image to the thumbnail size if set to YES.
@property (nonatomic) BOOL displayAsThumbnail
Discussion
Reduces the image to the thumbnail size if set to YES.
“as=1” - display as a thumbnail
“as=0” - display in a full size
Declared In
SCDownloadMediaOptions.h
height
Height (in pixels)
For example : “h=768”
@property (nonatomic) float height
Discussion
Height (in pixels)
For example : “h=768”
mediaOptions.height = 768;
Declared In
SCDownloadMediaOptions.h
language
For example : “la=en”
@property (nonatomic) NSString *language
Discussion
For example : “la=en”
mediaOptions.language = @“en”
Declared In
SCDownloadMediaOptions.h
maxHeight
MaxHeight (pixels)
For example : “mh=1080”
@property (nonatomic) float maxHeight
Discussion
MaxHeight (pixels)
For example : “mh=1080”
mediaOptions.maxHeight = 1080;
Declared In
SCDownloadMediaOptions.h
maxWidth
MaxWidth (pixels)
For example : “mw=1920”
@property (nonatomic) float maxWidth
Discussion
MaxWidth (pixels)
For example : “mw=1920”
mediaOptions.maxWidth = 1920;
Declared In
SCDownloadMediaOptions.h
scale
Scale factor for image resizing.
Set “1” for actual size.
Set “0.25” to reduce the image size to 25% of the original one.
You can also enlarge the image by setting positive values larger than “1”
@property (nonatomic) float scale
Discussion
Scale factor for image resizing.
Set “1” for actual size.
Set “0.25” to reduce the image size to 25% of the original one.
You can also enlarge the image by setting positive values larger than “1”
Negative values lead to undefined behaviour.
Declared In
SCDownloadMediaOptions.h