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 image
widthInches: number
- Desired width in inches
heightInches: number
- Desired height in inches
pxToInch: 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 image
widthInches: number
- Desired width in inches
heightInches: number
- Desired height in inches
pxToInch: 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