public class PropertyFilter extends Filter
SystemCapability.Multimedia#IMAGE| 构造器 | 说明 |
|---|---|
PropertyFilter() |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
long |
applyToSource(ImageSource source) |
Applies the configured Exif properties to the source file.
|
PropertyFilter |
restore() |
Restores all Exif properties.
|
PropertyFilter |
rollbackProperty(String key) |
Restores a specified Exif property.
|
PropertyFilter |
setPropertyDouble(String key,
double value) |
Sets an Exif property of the double type.
|
PropertyFilter |
setPropertyInt(String key,
int value) |
Sets an Exif property of the int type.
|
PropertyFilter |
setPropertyString(String key,
String value) |
Sets an Exif property of the string type.
|
public PropertyFilter setPropertyInt(String key, int value)
key - Indicates the property key, which is defined in PropertyKey.value - Indicates the property value.PropertyFilter object with the Exif property of the int type. This object can
be used for subsequent Exif-related operations.public PropertyFilter setPropertyDouble(String key, double value)
key - Indicates the property key, which is defined in PropertyKey.value - Indicates the property value.PropertyFilter object with the Exif property of the double type. The object
can be used for subsequent Exif-related operations.public PropertyFilter setPropertyString(String key, String value)
key - Indicates the property key, which is defined in PropertyKey.value - Indicates the property value.PropertyFilter object with the Exif property of the string type. The object
can be used for subsequent Exif-related operations.public PropertyFilter rollbackProperty(String key)
applyToSource(ImageSource).key - Indicates the property key, which is defined in PropertyKey.PropertyFilter object with the restored Exif property. The object can be used
for subsequent Exif-related operations.public PropertyFilter restore()
applyToSource(ImageSource).public long applyToSource(ImageSource source) throws IOException
This method requires the permission to modify the source file represented by the ImageSource
object. The configured Exif properties do not take effect until this method is called.
This method is applicable to the ImageSource object that has been created
based on a File object or a specified file path.
applyToSource 在类中 Filtersource - Indicates the image source file to which the properties will be applied.-1 otherwise.IOException - Throws this exception if the modification permission has not been obtained.IllegalArgumentException - Throws this exception if the image source is empty.IllegalStateException - Throws this exception if the ImageSource object has been released.