Skip to content

getimage not capturing background and certain window contents #20

Answered by ghost
ghost asked this question in Q&A
Discussion options

You must be logged in to vote

I have found the solution in bgra2rgba function i now set the alpha layer to max (255), this might be a bug or might just be x11 i don't know, but it took me a while since i was setting transparency to max in the actual GetImage function.

updated function:

func bgra2rgba(data []byte) {
	for i := 0; i < len(data); i += 4 {
		data[i], data[i+2] = data[i+2], data[i]
		data[i+3] = 255
	}
}

Hope this helps someone!

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant