473,405 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

What's BitBlt's DSTINVERT supposed to do?

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
2 3718
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
Killer42
8,435 Expert 8TB
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

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

Similar topics

9
by: Rajat Tandon | last post by:
Hello there, I am relatively new to the newsgroups and C#. I have never been disappointed with the groups and always got the prompt replies to my queries.This is yet another strange issue, I am...
1
by: _R | last post by:
I'm porting an old app from VC++6 to .NET and need to update the bitblt functions from DibSection to managed code. The older functions ran fine but I may as well opt for the fastest, most...
7
by: VB Programmer | last post by:
I am using the BitBlt operation to capture various controls into jpegs. It's almost like a screen capture, but of just the control. (This is a VB.NET application.) Because of BitBlt limitations...
6
by: Larry Serflaten | last post by:
Can anyone see something wrong with the code below? Friend Sub MapUpdate(ByRef Artwork As Bitmap, ByRef Player As MapObject) If grxForm Is Nothing Then grxForm = Me.CreateGraphics Dim hdcDst...
7
by: matt | last post by:
Hallo, I have to create a simple sprite movement; in VB6 I used the API BitBlt and all was very good. Using the NET graphical methods (not API) , the result is slow. Do you have a NET...
3
by: fripper | last post by:
Is there a way to use the windows bitblt function in a VB 2005 app? bitblt requires device context parameters for the source and destination controls but those are not used in VB 2005. Is there...
6
by: Martijn Mulder | last post by:
/* BitBlt.cs C# code using P/Invoke I have good reasons to use P/Invoke to get access to the Win32 API function BitBlt(). But I have trouble understanding the workings of it. Below is a...
5
by: =?Utf-8?B?UmljYXJkbyBGdXJ0YWRv?= | last post by:
I'm trying to copy a part of an image (a rectangle) width the bitblt api function, bu i receive an error when i try to do it. The error is the following, that i will try to translate because its in...
2
by: DumRat | last post by:
Hi, I want to run an animation(in essence). I want to draw multiple images (possibly .bmps, but I'd like other formats as well.) on to the screen each frame. I tried to do this with some C++...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.