1.0.0 • Published 6 months ago
ng-resizable-image v1.0.0
ng-resizable-image
An Angular component for resizing images with specified dimensions while maintaining image quality.
Installation
bash npm install ng-resizable-image
Usage
typescript import { ResizableImageComponent } from 'ng-resizable-image'; @NgModule({ imports: ResizableImageComponent })
In your template:
<app-resizable-image
[src]="'path/to/image.jpg'"
[widthInches]="15"
[heightInches]="24"
[pxToInch]="12"
></app-resizable-image>
API
Inputs
src: string
- Source URL of the imagewidthInches: number
- Desired width in inchesheightInches: number
- Desired height in inchespxToInch: number
- Pixels per inch ratio (default: 12)originalWidth: number
- Original width in inches (default: 15)originalHeight: number
- Original height in inches (default: 24)
Methods
exportAsSVG()
- Exports the resized image as SVG file
License
MIT
html:README.md <app-resizable-image src="'path/to/image.jpg'" widthInches="15" heightInches="24" pxToInch="12"
API
Inputs
src: string
- Source URL of the imagewidthInches: number
- Desired width in inchesheightInches: number
- Desired height in inchespxToInch: number
- Pixels per inch ratio (default: 12)originalWidth: number
- Original width in inches (default: 15)originalHeight: number
- Original height in inches (default: 24)
Methods
exportAsSVG()
- Exports the resized image as SVG file
License
MIT
1.0.0
6 months ago