[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

08/27/2009 at 07:11AM PDT, ID: 24686664
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

Rendering a background image in C# using Win32 API - BitBlt

Asked by dannyhop in Graphics & Game Programming, .NET, Microsoft Visual C#.Net

Tags: API, .NET, C# Csharp, graphics, background graphic

Hi All,
I am trying to render an API image to a background (image) memory location then use that image as a source for a BitBlt API call.
In my former life as a VB6 programmer I could simply render the image to a PictureBox (located off screen) with AutoRedraw = True.
I realize that this wasn't 'technically' rendering to memory but it served the purpose of giving me an 'off screen' intermediate memory location that had a HDC handle so I could use the hidden image as a source for BitBit.

I now find myself in the .NET - C# (C sharp) world trying to accomplish this same feat.
I can render from the EM_Message to an intermediate picture box but if it is not located in a visable area of the screen, it will not render.  This method acts like the old VB6 PictureBox with AutoRedrw = False.

I made a stab it it below....

1st I create a memory bitmap called intImage...
            Bitmap intImage = new Bitmap(533, 165);
then get a handle to it...
            IntPtr memHDC = intImage.GetHbitmap();

I have a feeling that maybe I am not creating a 'Graphic' but I am unsure how to do that?

Or maybe I just missing something simple that would allow me to render an API painted image in the background.

FYI - Note: I am using EM_FORMATRANGE (below) to render the initial image and it works fine when rendered to a PictureBox.
    //Render the selected RTF text into the tempPicBox hdc (from FORMATRANGE structure)
            res = SendMessage(Handle, EM_FORMATRANGE, wparam, lparam);

Thank You in advance for your time and kind assistance.
[+][-]08/27/09 08:28 AM, ID: 25199342

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Graphics & Game Programming, .NET, Microsoft Visual C#.Net
Tags: API, .NET, C# Csharp, graphics, background graphic
Sign Up Now!
Solution Provided By: Idle_Mind
Participating Experts: 2
Solution Grade: A
 
 
[+][-]08/27/09 09:23 AM, ID: 25199996

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/27/09 09:32 AM, ID: 25200097

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/27/09 10:31 AM, ID: 25200709

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-91 - Hierarchy / EE_QW_EXPERT_20070906