diff --git a/docs/doc.md b/docs/doc.md
index 3bf5192..36d429f 100644
--- a/docs/doc.md
+++ b/docs/doc.md
@@ -46,6 +46,7 @@
##### [TostringBitmap](#TostringBitmap)
##### [GetPortion](#GetPortion)
##### [Convert](#Convert)
+#### [FreeBitmap](#FreeBitmap)
## [Event](#Event)
@@ -398,6 +399,20 @@ robotgo.ScrollMouse(50, "down")
robotgo.Convert("test.png", "test.tif")
```
+###
.FreeBitmap(MMImageType)
+
+ FreeBitmap free and dealloc bitmap
+
+#### Arguments:
+
+ MMImageType
+
+#### Examples:
+
+```Go
+robotgo.FreeBitmap(bitmap)
+```
+
## Event
### .AddEvent(string)
diff --git a/docs/doc_zh.md b/docs/doc_zh.md
index 2bce1fc..9785970 100644
--- a/docs/doc_zh.md
+++ b/docs/doc_zh.md
@@ -49,6 +49,7 @@
##### [TostringBitmap](#TostringBitmap)
##### [GetPortion](#GetPortion)
##### [Convert](#Convert)
+#### [FreeBitmap](#FreeBitmap)
## [事件](#Event)
@@ -413,6 +414,20 @@ robotgo.ScrollMouse(50, "down")
```Go
robotgo.Convert("test.png", "test.tif")
```
+
+### .FreeBitmap(MMImageType)
+
+ FreeBitmap free and dealloc bitmap
+
+#### 参数:
+
+ MMImageType
+
+#### 示例:
+
+```Go
+robotgo.FreeBitmap(bitmap)
+```
## 事件
### .AddEvent(string)
diff --git a/robotgo.go b/robotgo.go
index 3c40b50..2fddcaa 100644
--- a/robotgo.go
+++ b/robotgo.go
@@ -639,6 +639,11 @@ func Convert(args ...interface{}) {
SaveBitmap(bitmap, spath, mtype)
}
+// FreeBitmap free and dealloc bitmap
+func FreeBitmap(ref C.MMBitmapRef) {
+ C.destroyMMBitmap(ref)
+}
+
/*
___________ ____ _______ .__ __. .___________.
| ____\ \ / / | ____|| \ | | | |