diff --git a/docs/api/QPixmap.md b/docs/api/QPixmap.md index f095fb6c4..9d3c4ada8 100644 --- a/docs/api/QPixmap.md +++ b/docs/api/QPixmap.md @@ -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) diff --git a/docs/api/QtEnums.md b/docs/api/QtEnums.md new file mode 100644 index 000000000..8d676b225 --- /dev/null +++ b/docs/api/QtEnums.md @@ -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"; +```