# VectorMaster
**Repository Path**: HarmonyOS-tpc/VectorMaster
## Basic Information
- **Project Name**: VectorMaster
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2021-09-17
- **Last Updated**: 2023-04-17
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# VectorMaster
## Introduction:
This library introduces dynamic control over vector image. Each and every aspect of a vector image can be controlled dynamically (via Java instances), using this library.
### VectorMaster includes:
1. Change vector image stroke color dynamically.
2. Change vector image stroke width dynamically.
3. Change vector image stroke opacity dynamically.
4. Change vector image fill color dynamically.
5. Trim vector image dynamically.
6. Using above features perform animation on vector image.
## Usage Instructions:
1. Add vector xml in the rawfile folder.
Note: Make sure the path in the xml(performing dynamic operation) should have name.
```
```
2 . Add the below code in the layout xml.
```
```
3 . Perform the dynamic operation on the path
```
VectorMasterView heart = (VectorMasterView) findComponentById(ResourceTable.Id_vector_master_heart);
// find the correct path using name
PathModel outline = heart.getPathModelByName("outline");
// set the stroke color
outline.setStrokeColor(Color.getIntColor("#FFD700"));
// set the fill color (if fill color is not set or is TRANSPARENT, then no fill is drawn)
outline.setFillColor(Color.getIntColor("#FFD700"));
// set trim path start (values are given in fraction of length)
outline.setTrimPathStart(0.0f);
// set trim path end (values are given in fraction of length)
outline.setTrimPathEnd(0.65f);
```
## Installation tutorial:
1 . For using VectorMaster modules in your sample application, add below dependencies to generate hap/har:
Modify entry build.gradle as below :
```
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar','*.har'])
implementation project(path: ':vectormaster')
}
```
2 . For using VectorMaster in separate application, add the below dependencies and include "VectorMaster.har", in libs folder of "entry" module :
Modify entry build.gradle as below :
```
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar','*.har'])
}
```
## License
Copyright 2016-17 Harjot Singh Oberai
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.