Nimbus
0.9.3 - Nimbus is proudly hosted on Github
An iOS framework whose growth is bounded by O(documentation).
|
The view and protocols used to display a network image.
Classes | |
class | NINetworkImageView |
A network-enabled image view that consumes minimal amounts of memory. More... | |
protocol | <NINetworkImageViewDelegate> |
The image view delegate used to inform of state changes. More... | |
Enumerations | |
enum | NINetworkImageViewScaleOptions |
Flags for modifying the way cropping is handled when scaling images to fit or fill.
By default the network image view will behave in the following way for these content modes:
The resulting image size will exactly match the display size.
You can modify this behavior using the following two flags which should be set using binary operators.
NINetworkImageViewScaleToFitCropsRemainder The final image size will be shrunk to fit the image such that there is no transparency. NINetworkImageViewScaleToFillLeavesRemainder The final image size will be grown to include the excess pixels.
The following examples use this image:
imageView.scaleOptions = NINetworkImageViewScaleToFitLeavesExcessAndScaleToFillCropsExcess;
[imageView setPathToNetworkImage: @"http://farm2.static.flickr.com/1165/644335254_4b8a712be5.jpg"
forDisplaySize: CGSizeMake(100, 100)
contentMode: UIViewContentModeScaleAspectFit];
source image size: 500x375 [aspect ratio: 1.3333]
display size: 100x100 [aspect ratio: 1]
result image size: 100x100 [aspect ratio: 1] (transparency on the left and right edges)
image blt size: 100x75 [aspect ratio: 1.3333]
[imageView setPathToNetworkImage: @"http://farm2.static.flickr.com/1165/644335254_4b8a712be5.jpg"
forDisplaySize: CGSizeMake(100, 100)
contentMode: UIViewContentModeScaleAspectFill];
source image size: 500x375 [aspect ratio: 1.3333]
display size: 100x100 [aspect ratio: 1]
result image size: 100x100 [aspect ratio: 1]
image blt size: 133x100 [aspect ratio: 1.3333]
// Turn on NINetworkImageViewScaleToFitCropsExcess imageView.scaleOptions |= NINetworkImageViewScaleToFitCropsExcess; [imageView setPathToNetworkImage: @"http://farm2.static.flickr.com/1165/644335254_4b8a712be5.jpg" forDisplaySize: CGSizeMake(100, 100) contentMode: UIViewContentModeScaleAspectFill]; source image size: 500x375 [aspect ratio: 1.3333] display size: 100x100 [aspect ratio: 1] result image size: 100x75 [aspect ratio: 1.3333] image blt size: 100x75 [aspect ratio: 1.3333]
// Turn on NINetworkImageViewScaleToFillLeavesExcess imageView.scaleOptions |= NINetworkImageViewScaleToFillLeavesExcess; [imageView setPathToNetworkImage: @"http://farm2.static.flickr.com/1165/644335254_4b8a712be5.jpg" forDisplaySize: CGSizeMake(100, 100) contentMode: UIViewContentModeScaleAspectFill]; source image size: 500x375 [aspect ratio: 1.3333] display size: 100x100 [aspect ratio: 1] result image size: 133x100 [aspect ratio: 1.3333] image blt size: 133x100 [aspect ratio: 1.3333]
Definition at line 41 of file NINetworkImageView.h.