I am trying to write a program in Golang to get image data from Windows Clipboard.

I understand that [there is a plugin for getting data from Windows Clipboard](http://atotto/clipboard:%20clipboard%20for%20golang%20-%20GitHub), the problem is it does not support image data, text only. Basically just not what am I looking for.

```
package main

import ("fmt"
        "github.com/atotto/clipboard"
)

func main()  {
    str,err:=clipboard.ReadAll()
    if err!=nil {
        fmt.Println(err)        
    }else {
        fmt.Println(str)
    }
}

```

This will output the "The operation completed successfully." error if the clipboard contains an image.

Any idea how to do this?

**Update!:**

I tried passing `CF_BITMAP` to `GetClipboardData`, which return a handle to a bitmap (Hbitmap). I am not familiar with handling that, but apparently it is a long unsigned number?

Anyway, I tried some googling at came to [this](https://github.com/lxn/win/blob/master/gdiplus.go). Using the function `GdipCreateBitmapFromHBITMAP`: 

```
var Bitmap *win.GpBitmap
pBitmap := &Bitmap
fmt.Println(win.GdipCreateBitmapFromHBITMAP(win.HBITMAP(Hbitmap),0,pBitmap))

```

I got an "ok" output, but the Bitmap is empty. And I am stuck again.

How am I supposed to store the bitmap?