|
|
|
|
|
|
ImageRepeat repeat = ImageRepeat.noRepeat, |
|
|
|
Rect centerSlice = null, |
|
|
|
bool gaplessPlayback = false, |
|
|
|
FilterMode filterMode = FilterMode.Bilinear |
|
|
|
FilterQuality filterQuality = FilterQuality.low |
|
|
|
) : base(key) { |
|
|
|
D.assert(image != null); |
|
|
|
this.image = image; |
|
|
|
|
|
|
this.repeat = repeat; |
|
|
|
this.centerSlice = centerSlice; |
|
|
|
this.gaplessPlayback = gaplessPlayback; |
|
|
|
this.filterMode = filterMode; |
|
|
|
this.filterQuality = filterQuality; |
|
|
|
} |
|
|
|
|
|
|
|
public static Image network( |
|
|
|
|
|
|
ImageRepeat repeat = ImageRepeat.noRepeat, |
|
|
|
Rect centerSlice = null, |
|
|
|
bool gaplessPlayback = false, |
|
|
|
FilterMode filterMode = FilterMode.Bilinear, |
|
|
|
FilterQuality filterQuality = FilterQuality.low, |
|
|
|
IDictionary<string, string> headers = null |
|
|
|
) { |
|
|
|
var networkImage = new NetworkImage(src, scale, headers); |
|
|
|
|
|
|
repeat, |
|
|
|
centerSlice, |
|
|
|
gaplessPlayback, |
|
|
|
filterMode |
|
|
|
filterQuality |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
ImageRepeat repeat = ImageRepeat.noRepeat, |
|
|
|
Rect centerSlice = null, |
|
|
|
bool gaplessPlayback = false, |
|
|
|
FilterMode filterMode = FilterMode.Bilinear |
|
|
|
FilterQuality filterQuality = FilterQuality.low |
|
|
|
) { |
|
|
|
var fileImage = new FileImage(file, scale); |
|
|
|
return new Image( |
|
|
|
|
|
|
repeat, |
|
|
|
centerSlice, |
|
|
|
gaplessPlayback, |
|
|
|
filterMode |
|
|
|
filterQuality |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
ImageRepeat repeat = ImageRepeat.noRepeat, |
|
|
|
Rect centerSlice = null, |
|
|
|
bool gaplessPlayback = false, |
|
|
|
FilterMode filterMode = FilterMode.Bilinear |
|
|
|
FilterQuality filterQuality = FilterQuality.low |
|
|
|
) { |
|
|
|
var image = scale != null |
|
|
|
? (AssetBundleImageProvider) new ExactAssetImage(name, bundle: bundle, scale: scale.Value) |
|
|
|
|
|
|
repeat, |
|
|
|
centerSlice, |
|
|
|
gaplessPlayback, |
|
|
|
filterMode |
|
|
|
filterQuality |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
ImageRepeat repeat = ImageRepeat.noRepeat, |
|
|
|
Rect centerSlice = null, |
|
|
|
bool gaplessPlayback = false, |
|
|
|
FilterMode filterMode = FilterMode.Bilinear |
|
|
|
FilterQuality filterQuality = FilterQuality.low |
|
|
|
) { |
|
|
|
var memoryImage = new MemoryImage(bytes, scale); |
|
|
|
return new Image( |
|
|
|
|
|
|
repeat, |
|
|
|
centerSlice, |
|
|
|
gaplessPlayback, |
|
|
|
filterMode |
|
|
|
filterQuality |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
public readonly Color color; |
|
|
|
public readonly FilterMode filterMode; |
|
|
|
public readonly FilterQuality filterQuality; |
|
|
|
public readonly BlendMode colorBlendMode; |
|
|
|
public readonly BoxFit? fit; |
|
|
|
public readonly Alignment alignment; |
|
|
|
|
|
|
properties.add(new EnumProperty<ImageRepeat>("repeat", repeat, defaultValue: ImageRepeat.noRepeat)); |
|
|
|
properties.add(new DiagnosticsProperty<Rect>("centerSlice", centerSlice, |
|
|
|
defaultValue: foundation_.kNullDefaultValue)); |
|
|
|
properties.add(new EnumProperty<FilterMode>("filterMode", filterMode, foundation_.kNullDefaultValue)); |
|
|
|
properties.add(new EnumProperty<FilterQuality>("filterQuality", filterQuality, foundation_.kNullDefaultValue)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
repeat: widget.repeat, |
|
|
|
centerSlice: widget.centerSlice, |
|
|
|
invertColors: _invertColors, |
|
|
|
filterMode: widget.filterMode |
|
|
|
filterQuality: widget.filterQuality |
|
|
|
); |
|
|
|
|
|
|
|
return image; |
|
|
|