Hi,
Can anyone plz help?
I have the following code for the WM_PAINT event, but it doesn't work. Need to knw why. I'm drawing the scene to the window, but am using an intermediate DC. Then it just shows a white screen, however, if I drop the intermediate DC, it works. I need to know why this fails. Thanks in advance. -
case WM_PAINT:
-
{
-
HBITMAP hBm = (HBITMAP)LoadImageA(NULL, "black.bmp", IMAGE_BITMAP, 768, 768, LR_LOADFROMFILE);
-
HBITMAP hBmMask = (HBITMAP)LoadImageA(NULL, "blackm.bmp", IMAGE_BITMAP, 768, 768, LR_LOADFROMFILE);
-
HDC ourDC = CreateCompatibleDC(GetDC(hWnd));
-
HDC comDC = CreateCompatibleDC(ourDC);
-
HDC mDC = CreateCompatibleDC(ourDC);
-
HBITMAP old = (HBITMAP)SelectObject(comDC, hBm);
-
HBITMAP old2 = (HBITMAP)SelectObject(mDC, hBmMask);
-
-
BitBlt(ourDC, 0, 0, 768, 768, mDC, 0, 0, SRCAND);
-
BitBlt(ourDC, 0, 0, 768, 768, comDC, 0, 0, SRCPAINT);
-
-
BitBlt(GetDC(hWnd), 0, 0, 768, 768, ourDC, 0, 0, SRCCOPY);
-
}
-
break;
-
1 2518
a late response it seems. have you found out where the problem was?
i remember having similar problems - some years ago though. did you try to createcompatibledc from the same GetDC?
r.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: DraguVaso |
last post by:
Hi,
In the override of the Paint-method of a DataGridTextBoxColumn I want to
show an image with BitBlt, to see what I can gain there on performance.
The problem is: It doesn't show me the image...
|
by: JackS |
last post by:
I am trying to use GDI32 bitblt to write a bitmap to a control's window, but all I get is an empty rectangle of some rop-dependent color. In short, I use the following logic in a paint event handler:...
|
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...
|
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...
|
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...
|
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...
|
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...
|
by: =?Utf-8?B?Y3JhbmtlX2JveQ==?= |
last post by:
Hi Folks,
I'm not sure where this post belongs since I'm using managed vc.net, but the
issue is around GDI BitBlt.
Here is a summary of the problem:
- I am trying to copy a bitmap of my main...
|
by: crankeboy |
last post by:
Hi Folks,
My setup: Visual Studio Express 2008, VC++, .NET, BitBlt
Here is a summary of the problem:
- I am trying to copy a bitmap of my main form into a picture box.
- To do this, I bitblt...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |