473,471 Members | 1,981 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Drawing Bitmaps during Run-Time(Visual C++ 2008)

29 New Member
Hie all
I am struggling on how i can display bitmaps during runtime. so i want to display a picture in the OnInitDialog().
I have researched on various websites but they didnt provide enough information on this issue.

i managed to get a function that does that but i want to know how exactly do i implement it

here is the code

Expand|Select|Wrap|Line Numbers
  1. void DisplayBitmap( CBitmap *p, CDC *pDC)
  2. // display the given bitmap on the given device context.
  3. // It is assumed that LoadBitmap has already been called.
  4. {  CDC dcMemory;
  5.    BITMAP bm;
  6.    dcMemory.CreateCompatibleDC(pDC);
  7.    dcMemory.SelectObject(p);
  8.    /* Get the height and width of the bitmap */
  9.    p->GetBitmap(&bm);
  10.    pDC->BitBlt(50,50,bm.bmWidth,bm.bmHeight,&dcMemory,0,0,SRCCOPY);
  11. }
  12.  
,
Expand|Select|Wrap|Line Numbers
  1. void CBitmapDemo1View::OnDraw(CDC* pDC)
  2. {  
  3.           CBitmapDemo1Doc* pDoc = GetDocument();
  4.           ASSERT_VALID(pDoc);
  5.           DisplayBitmap(&m_Bitmap,pDC);
  6. }
  7.  
  8.  
Could someone help me on how to implement this

thanks in advance.
Sep 27 '11 #1
0 1140

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

Similar topics

1
by: Tom Rahav | last post by:
Hello all! I develop application in Visual Basic .NET and ORACLE database. My question is how do I "send" script file to the database using visual basic .net. Other words, is there any way to...
5
by: Jeff | last post by:
I wrote a simple VB.NET program that runs on a computer ONLY if I install Visual Studio 2003 on that computer. The computer already had .NET Framework 1.1 installed. If it is run on a computer...
4
by: Charts | last post by:
6/23/05 ..NET Development\Framework\dotnet.framework.aspnet Visual Studio 2005 Beta 2 project cannot work in IIS virtual directory I used Visual Studio 2005 Beta 2 to build a simple new...
4
by: Fla | last post by:
Good morning. I'd like to know if I can use for free the animations, the bitmaps and the icons inside the archive VS2005ImageLibrary.zip in the installation path of VB2005 C:\Program...
2
by: JM | last post by:
Hi, I used to chage my code during debugging with Visual Studio 2003 (I just stopped the code using a break point and VS2003 allowed me to change the code, and continue debugging), but now with...
0
by: =?Utf-8?B?SmVzcGVyLCBEZW5tYXJr?= | last post by:
Hi, How can I select the ' transperant color' in the in Visual Studio IDE image editor? I have a imageList using the default transperant color 'Color.Transperant'. regards Jesper, Denmark
1
by: Jeff | last post by:
Hey I'm wonder if installing Visual Web Developer 2008 Express version an Express version of Sql Server 2005/2008 will be installed too or must Sql Server Express be installed separately??
0
by: =?Utf-8?B?bmFfa3J1bA==?= | last post by:
Hi, I've just converting my application froml visual 2005 to 2008 one. the 32-bit version is OK, but the 64-bit version is not running (debug or release is the same) That's give me an error :...
2
by: =?Utf-8?B?RGF2aWQ=?= | last post by:
Hello I'm trying to develop a Windows service, in visual studio 2005, which executes a visual basic script. However, if the script interacts with the file system (as it has to), the script...
1
by: duckie | last post by:
I was sent a code made in Microsoft Visual C++ 2005, and when I run it in 2008, i get this: error C4335: Mac file format detected: please convert the source file to either DOS or UNIX format ...
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
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.