Click here to Skip to main content
15,878,028 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How Print multiple copies with printdlg in MFC Pin
haha_c20-Feb-13 21:54
haha_c20-Feb-13 21:54 
GeneralRe: How Print multiple copies with printdlg in MFC Pin
Richard MacCutchan20-Feb-13 22:39
mveRichard MacCutchan20-Feb-13 22:39 
GeneralRe: How Print multiple copies with printdlg in MFC Pin
haha_c20-Feb-13 23:31
haha_c20-Feb-13 23:31 
QuestionLoad an image dynamically in win32 using VC++ Pin
Sachin k Rajput 20-Feb-13 20:05
Sachin k Rajput 20-Feb-13 20:05 
AnswerRe: Load an image dynamically in win32 using VC++ Pin
_AnsHUMAN_ 20-Feb-13 20:56
_AnsHUMAN_ 20-Feb-13 20:56 
AnswerRe: Load an image dynamically in win32 using VC++ Pin
Richard MacCutchan20-Feb-13 22:32
mveRichard MacCutchan20-Feb-13 22:32 
GeneralRe: Load an image dynamically in win32 using VC++ Pin
Sachin k Rajput 21-Feb-13 0:27
Sachin k Rajput 21-Feb-13 0:27 
GeneralRe: Load an image dynamically in win32 using VC++ Pin
Richard MacCutchan21-Feb-13 1:14
mveRichard MacCutchan21-Feb-13 1:14 
You can copy the buffer to a global memory buffer, then use CreateStreamOnHGlobal[^] to get the image buffer as a stream, which can then be passed to Image.FromStream[^]. The following should (I hope) help to clarify it:
C++
// allocate a global memory block and copy the image data to it
// dwFileSize is size of image buffer in memory (or file size if reading directly)
HGLOBAL hGlobal = GlobalAlloc(GMEM_MOVEABLE, dwFileSize);
PVOID pvData = GlobalLock(hGlobal);
CopyMemory(pvData, pImageData, dwFileSize);  // pImageData is source memory buffer
GlobalUnlock(hGlobal);

IStream* pStream;
// create IStream* from global memory which will
// be freed automatically when the stream is released
HRESULT hResult = CreateStreamOnHGlobal(hGlobal, TRUE, &pStream);
Image* pImage = Image::FromStream(pStream);
pStream->Release();

RectF destRect; // set values to destination location and size
Graphics graphics(hDC);
graphics.DrawImage(pImage, destRect);
delete pImage;

AnswerRe: Load an image dynamically in win32 using VC++ Pin
Shaheed Legion26-Feb-13 5:10
Shaheed Legion26-Feb-13 5:10 
QuestionWhy does so many companies use directUI to show GUI ? Pin
yu-jian20-Feb-13 15:09
yu-jian20-Feb-13 15:09 
QuestionCFileDialog in Dll Project Pin
LeeUnSong20-Feb-13 14:38
LeeUnSong20-Feb-13 14:38 
AnswerRe: CFileDialog in Dll Project Pin
Richard MacCutchan20-Feb-13 21:10
mveRichard MacCutchan20-Feb-13 21:10 
GeneralRe: CFileDialog in Dll Project Pin
LeeUnSong21-Feb-13 0:31
LeeUnSong21-Feb-13 0:31 
GeneralRe: CFileDialog in Dll Project Pin
Richard MacCutchan21-Feb-13 1:16
mveRichard MacCutchan21-Feb-13 1:16 
QuestionFormatting Output Pin
Sarah Trattner20-Feb-13 12:02
Sarah Trattner20-Feb-13 12:02 
AnswerRe: Formatting Output Pin
Garth J Lancaster20-Feb-13 12:33
professionalGarth J Lancaster20-Feb-13 12:33 
GeneralRe: Formatting Output Pin
Sarah Trattner20-Feb-13 13:00
Sarah Trattner20-Feb-13 13:00 
GeneralRe: Formatting Output Pin
Garth J Lancaster20-Feb-13 13:26
professionalGarth J Lancaster20-Feb-13 13:26 
GeneralRe: Formatting Output Pin
Garth J Lancaster20-Feb-13 13:37
professionalGarth J Lancaster20-Feb-13 13:37 
QuestionBOM Code Pin
Michael Haephrati20-Feb-13 10:41
professionalMichael Haephrati20-Feb-13 10:41 
SuggestionRe: BOM Code Pin
David Crow20-Feb-13 10:47
David Crow20-Feb-13 10:47 
GeneralRe: BOM Code Pin
Michael Haephrati20-Feb-13 10:49
professionalMichael Haephrati20-Feb-13 10:49 
QuestionOn displaying two images second image overlapps first image Pin
Sachin k Rajput 20-Feb-13 0:32
Sachin k Rajput 20-Feb-13 0:32 
AnswerRe: On displaying two images second image overlapps first image Pin
Richard MacCutchan20-Feb-13 2:40
mveRichard MacCutchan20-Feb-13 2:40 
AnswerRe: On displaying two images second image overlapps first image Pin
Michael Haephrati20-Feb-13 10:15
professionalMichael Haephrati20-Feb-13 10:15 

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.