Click here to Skip to main content
15,910,981 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: from file to other file Pin
CPallini3-Jul-08 21:15
mveCPallini3-Jul-08 21:15 
QuestionTrap/wrap CListCtrl messages Pin
john john mackey3-Jul-08 8:42
john john mackey3-Jul-08 8:42 
AnswerRe: Trap/wrap CListCtrl messages Pin
led mike3-Jul-08 9:09
led mike3-Jul-08 9:09 
GeneralRe: Trap/wrap CListCtrl messages Pin
john john mackey3-Jul-08 9:33
john john mackey3-Jul-08 9:33 
QuestionDrawing a BitMap Pin
Cozmo233-Jul-08 7:05
Cozmo233-Jul-08 7:05 
QuestionRe: Drawing a BitMap Pin
Mark Salsbery3-Jul-08 7:28
Mark Salsbery3-Jul-08 7:28 
AnswerRe: Drawing a BitMap Pin
Cozmo233-Jul-08 7:39
Cozmo233-Jul-08 7:39 
GeneralRe: Drawing a BitMap Pin
Mark Salsbery3-Jul-08 7:52
Mark Salsbery3-Jul-08 7:52 
I suppose the easiest way is using GDI+
#include <gdiplus.h>

#pragma comment(lib, "gdiplus.lib" )

...
	ULONG dwToken;
	Gdiplus::GdiplusStartupInput input;
	Gdiplus::GdiplusStartupOutput output;
	Gdiplus::Status status = Gdiplus::GdiplusStartup(&dwToken, &input, &output);
	if(status == Gdiplus::Ok)
	{
		Gdiplus::Bitmap SrcBitmap(L"c:\\my.jpg", FALSE);
		Graphics DestGraphics(hwndWindowToDrawOn);
		DestGraphics.DrawImage(&SrcBitmap, 0, 0);

		Gdiplus::GdiplusShutdown(dwToken);
	}

Note that if you use gdi+, all that initialization code only needs to be done once at application
startup and shutdown, so it really only takes 3 lines of code to load and render a bitmap.

Mark







GeneralRe: Drawing a BitMap Pin
Mark Salsbery3-Jul-08 8:02
Mark Salsbery3-Jul-08 8:02 
QuestionReading the display fron other programs Pin
Kwanalouie3-Jul-08 7:00
Kwanalouie3-Jul-08 7:00 
AnswerRe: Reading the display fron other programs Pin
Rahul Vaishnav3-Jul-08 12:45
Rahul Vaishnav3-Jul-08 12:45 
GeneralRe: Reading the display fron other programs Pin
Kwanalouie3-Jul-08 23:41
Kwanalouie3-Jul-08 23:41 
QuestionHow do you include "Download" capabilities in a Web Page? Pin
Larry Mills Sr3-Jul-08 6:54
Larry Mills Sr3-Jul-08 6:54 
AnswerRe: How do you include "Download" capabilities in a Web Page? Pin
led mike3-Jul-08 8:01
led mike3-Jul-08 8:01 
GeneralRe: How do you include "Download" capabilities in a Web Page? Pin
Larry Mills Sr3-Jul-08 17:06
Larry Mills Sr3-Jul-08 17:06 
Questionhow to hold the console application. Pin
Nandu_77b3-Jul-08 6:51
Nandu_77b3-Jul-08 6:51 
AnswerRe: how to hold the console application. Pin
krmed3-Jul-08 7:28
krmed3-Jul-08 7:28 
GeneralRe: how to hold the console application. Pin
Nandu_77b3-Jul-08 21:36
Nandu_77b3-Jul-08 21:36 
GeneralRe: how to hold the console application. Pin
krmed4-Jul-08 4:46
krmed4-Jul-08 4:46 
AnswerRe: how to hold the console application. Pin
Saurabh.Garg3-Jul-08 17:53
Saurabh.Garg3-Jul-08 17:53 
QuestionRe: how to hold the console application. Pin
Nandu_77b3-Jul-08 23:19
Nandu_77b3-Jul-08 23:19 
AnswerRe: how to hold the console application. [modified] Pin
Saurabh.Garg3-Jul-08 23:35
Saurabh.Garg3-Jul-08 23:35 
QuestionHow to resize control when screen resolution changed? Pin
hanlei00000000093-Jul-08 5:50
hanlei00000000093-Jul-08 5:50 
AnswerRe: How to resize control when screen resolution changed? Pin
leonigah3-Jul-08 19:06
leonigah3-Jul-08 19:06 
QuestionRegarding propertysheets Pin
Member 46556853-Jul-08 4:57
Member 46556853-Jul-08 4:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.