473,324 Members | 2,257 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,324 software developers and data experts.

GDI handles in C++

Hi,

I need to convert a System.Drawing.Bitmap into a GDI bitmap, store the GDI
bitmap, and then later display it using BitBlt.

The storing part is giving me a little trouble.

Given a paint event, I can happily create a Bitmap, call
GetHBitmap()->ToPointer on it, and then SelectObject the resulting pointer
in a DC and display it into the Graphics object from PaintEventArgs.

However, storing it for a while and then trying to display isn't having such
happy results. Which leads me to believe that I'm doing something that means
the GDI pointer isn't valid, and the case above is working as a fluke.
There's also no code I can find which does any more than converting a
System.Drawing.Image to a GDI bitmap, displays it, and releases the GDI
object, which isn't going to work for me because the conversion is
prohibitively slow. And having never worked in GDI (and now realising why),
this is causing some frustration. Any help would really be appreciated!

Steve
Nov 17 '05 #1
0 802

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Rohit | last post by:
Hi, Threads in the .NET Framework 1.1 (and possibly in 1.0 also) leak "Event" handles, by Event handles I mean Win32 Event handles which can be monitored using the ProcessExplorer from...
1
by: Darren Wooding | last post by:
Hello, can anyone offer any advice, this one is driving me up the wall! 1. I am using a webform datagrid. 2. The columns are all dynamic and defined using templates (see code below). 3. I have...
6
by: enki | last post by:
I have been reading Ruminations on C++, a very interesting book. They are going into handles. I think what they are doing is very intersting and very confusing. I have to read each paragraph...
5
by: LBT | last post by:
I have a window service written in VB.NET to scan directory and process file. During directory scanning (scheduled by timer using System.IO.Directory.GetFiles method), I can observe that the column...
3
by: Brett | last post by:
I'm using a third part component in a certain app. The component has methods and events. I noticed one particular event was not firing after a while but it should have been. The problem was the...
12
by: johnb41 | last post by:
This question is regarding the "Handles" part of a routine, for example: Handles Button1.Click On Form2 (a User Control) I have a button. Here's it's code: Public Sub Button1_Click(ByVal...
7
by: Simon Verona | last post by:
I have a problem in my application which I believe is due to open handles.. . The symptom that users report is that after they have been using the application for a while, it will randomly just...
6
by: antonyliu2002 | last post by:
Right now I put my VB code in the aspx pages. I would prefer to use codebehind, especially many of my VB functions may be shared across multiple aspx pages. I've tried a few pages with...
2
by: sck10 | last post by:
Hello, Is there an equivalent to using "Handles" in the codebehind for c#? Or do I have to declare every event in the GridView control like the following: <asp:GridView ID="gvSearchList"...
7
by: Jurgen Haan | last post by:
Hi there. Recently, one of our application servers is moaning about its handles. (no more handles available). I'm guessing it has to do with some bug in our software where it does not release...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
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...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
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)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
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
0
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...
0
isladogs
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...

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.