Updated docs

This commit is contained in:
Atul R 2019-08-04 12:03:34 +02:00
parent 942c96e546
commit 5311f612c7
2 changed files with 22 additions and 0 deletions

View File

@ -41,3 +41,12 @@ loads an image from the url into memory as a Pixmap.
returns true if load was successful otherwise returns false.
- `imageUrl` string (_optional_). Absolute path of the image that needs to be loaded in the memory.
#### `pixMap.scaled(width, height, aspectRatioMode?)`
Scales the pixmap to provided height and width with respect to aspectRatioMode.
This method doesnt mutate this pixmap and rather returns a new pixmap with new height and width.
- `width` number. Width in pixels for new pixmap.
- `height` number. Height in pixels for new pixmap.
- `aspectRatioMode` AspectRatioMode (_optional_). Specifies how scaling should happen. [AspectRatio is an enum from Qt](QtEnums.md)

13
docs/api/QtEnums.md Normal file
View File

@ -0,0 +1,13 @@
## Enums from Qt
For a complete list of Enums that we can use from Javascript see file
Qt enums: [`src/lib/QtEnums/index.ts`](https://github.com/master-atul/nodegui/blob/master/src/lib/QtEnums/index.ts) in the NodeGui repo.
All the enums in this file can be imported directly from `@nodegui/@nodegui`.
### Example
```js
import { AspectRatioMode } from "@nodegui/nodegui";
```