By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 664 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

What's BitBlt's DSTINVERT supposed to do?

P: 98
The description in MSDN states that DSTINVERT "Inverts the destination rectangle." I imagined that this might mean something like "does a 'bitwise not' on the colors" - for example, a pixel that is RGB(255, 0, 10) becomes RGB(0, 255, 245).

However, when I tried a simple little test, what actually happened was that the entire picture went black.

My test was just a simple form in VB6, with a command button "Command1" and a picture box "Picture1", with the box preloaded with some image, and the code:

Private Sub Command1_Click()
BitBlt Picture1.hDC, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight, _
0, 0, 0, DSTINVERT
End Sub

The only other code was the declare of BitBlt from the gdi32 lib.

Am I doing something wrong?
Jan 15 '08 #1
Share this Question
Share on Google+
2 Replies

P: 98
OK, that was incredibly stupid.

I didn't include the declaration for what DSTINVERT meant. I also didn't include "Option Explicit". So when the VB IDE interpreter encountered it, it assumed that DSTINVERT meant 0, which is equivalent to the raster op BLACKNESS.
Jan 15 '08 #2

Expert 5K+
P: 8,434
OK, that was incredibly stupid.

I didn't include ...
So this one is sorted, then? Gee, that was an easy one! :)

(This is why I always recommend people use Option Explicit. It just confuses things when VB tries to "help out" by creating things for you like this.)
Jan 16 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.