mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
refactor: remove redundant NativeImage::GetBitmap() (#46736)
* refactor: remove redundant NativeImage::GetBitmap() Co-authored-by: Charles Kerr <charles@charleskerr.com> * docs: mark NativeImage.getBitmap() as deprecated Co-authored-by: Charles Kerr <charles@charleskerr.com> * have getBitmap() emit a deprecation warning Co-authored-by: David Sanders <dsanders11@ucsbalum.com> * docs: update obsolete refefence to getBitmap() Co-authored-by: Charles Kerr <charles@charleskerr.com> * test: update obsolete refefences to getBitmap() Co-authored-by: Charles Kerr <charles@charleskerr.com> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com> Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
This commit is contained in:
@@ -271,16 +271,12 @@ changes:
|
||||
|
||||
Returns `string` - The [Data URL][data-url] of the image.
|
||||
|
||||
#### `image.getBitmap([options])`
|
||||
#### `image.getBitmap([options])` _Deprecated_
|
||||
|
||||
* `options` Object (optional)
|
||||
* `scaleFactor` Number (optional) - Defaults to 1.0.
|
||||
|
||||
Returns `Buffer` - A [Buffer][buffer] that contains the image's raw bitmap pixel data.
|
||||
|
||||
The difference between `getBitmap()` and `toBitmap()` is that `getBitmap()` does not
|
||||
copy the bitmap data, so you have to use the returned Buffer immediately in
|
||||
current event loop tick; otherwise the data might be changed or destroyed.
|
||||
Legacy alias for `image.toBitmap()`.
|
||||
|
||||
#### `image.getNativeHandle()` _macOS_
|
||||
|
||||
|
||||
Reference in New Issue
Block a user