Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

malpass

Comparing Transparent Bitmaps

This topic is 5555 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Guest Anonymous Poster
What?

Share this post


Link to post
Share on other sites
i''ve read your post 3 times, but couldn''t figure out exactly...

do you want to compare 2 rectangular areas of one or more image(s), taking the transparency (i.e. color-key or alpha values) into account? i.e. using one image as some sort of alpha-mask to see which pixels you want to copy into a new image, and which pixels to skip?

Share this post


Link to post
Share on other sites
ok, first I want to be able to read part of the screen into a bitmap (like a print screen, but just a section) called "screen".

Then, i have another bitmap of a picture called "pic", and thats transparent. I want to make "screen" transparent, but only in the parts that are transparent on "pic".

Then I want to compare them to check if there identical

Share this post


Link to post
Share on other sites
ok, start with the first question, how do I get color from a location of the screen, possibly a full section, not just pixel.

I tryed importing GetPixel() from C++ like this:

// Get pixel at point
[DllImport("gdi32.dll")]
public static extern int GetPixel(IntPtr hWnd, int x, int y);

that imports fine but I don''t know if the return value is right because that function when I use it in C# returns -1. I tryed telling it to return byte and Color but if I try Color it can''t import it, and if i try byte it returns 255 all the time.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
why not use the c# functions?

Share this post


Link to post
Share on other sites
because there arent any to get screen pixels.

What if i call Print Screen (I can do that) then somehow import the bitmap from the clipboard, can anyone tell me how to do that?

Share this post


Link to post
Share on other sites
i''v managed to do a wierd thing that now gets me a screen cap, but now how can I make that transparent according to the transparency of another image, or just check the non-transparent bits of the other image with the same bits on the screen cap?

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!