Click here to Skip to main content
15,916,293 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: E-mail sending? Authentication?please help. Pin
G Haranadh15-Mar-07 0:34
G Haranadh15-Mar-07 0:34 
GeneralRe: E-mail sending? Authentication?please help. Pin
ThatsAlok15-Mar-07 0:40
ThatsAlok15-Mar-07 0:40 
GeneralRe: E-mail sending? Authentication?please help. Pin
G Haranadh21-Mar-07 19:53
G Haranadh21-Mar-07 19:53 
GeneralRe: E-mail sending? Authentication?please help. Pin
ThatsAlok21-Mar-07 19:57
ThatsAlok21-Mar-07 19:57 
Questiondrawing to memory dc from a view that isnt visible Pin
pedoublety14-Mar-07 6:45
pedoublety14-Mar-07 6:45 
AnswerRe: drawing to memory dc from a view that isnt visible Pin
Mark Salsbery14-Mar-07 7:11
Mark Salsbery14-Mar-07 7:11 
AnswerRe: drawing to memory dc from a view that isnt visible Pin
John R. Shaw14-Mar-07 15:48
John R. Shaw14-Mar-07 15:48 
GeneralRe: drawing to memory dc from a view that isnt visible Pin
pedoublety14-Mar-07 23:13
pedoublety14-Mar-07 23:13 
Hi, thanks.

Thats the sort of thing i was trying but i'd end up with loads of black lines like a barcode.

I thought it might be because the hwnd of the view hadnt been setup properly or something. My graph data is stored seperately from the view which simply manages the DC and mouse/key strokes.

(The reason im doing it this way is that one view can be made to show different graphs)

I'm trying something that vaguely resembles...

CGraphView dummyview; (derived from CView)<br />
dummyview.SetMyGraph(graph);<br />
dummyview.SetSize(rect);<br />
dummyview.WriteToBitmap("bitmap.bmp")<br />
<br />
CGraphView::WriteToBitmap(CString file)<br />
{<br />
CDC pDC;<br />
pDC.CreateCompatibleDC(CDC::FromHandle(wglGetCurrentDC()));<br />
<br />
CBitmap bitmap;<br />
bitmap.CreateCompatibleBitmap(&pDC, rect.Width());<br />
CBitmap* oldBitmap = pDC.SelectObject(&bitmap);<br />
<br />
OnDraw(&pDC);<br />
<br />
int pixels = rect.Width() * rect.Height();<br />
BYTE* bits = new BYTE[pixels*4];<br />
<br />
glReadBuffer(GL_BACK);<br />
glReadPixels(rect.left, rect.bottom,rect.Width(),rect.Height(),GL_RGBA,GL_UNSIGNED_BYTE,bits);<br />
...<br />
bitmap.SetBitmapBits(pixels*4,bits);<br />
...<br />
then write bitmap to file<br />
}

GeneralRe: drawing to memory dc from a view that isnt visible Pin
Mark Salsbery15-Mar-07 5:54
Mark Salsbery15-Mar-07 5:54 
Questionhi need a little help with rar files Pin
DxCx14-Mar-07 6:28
DxCx14-Mar-07 6:28 
AnswerRe: hi need a little help with rar files Pin
Dominik Reichl14-Mar-07 10:04
Dominik Reichl14-Mar-07 10:04 
GeneralRe: hi need a little help with rar files Pin
DxCx14-Mar-07 22:16
DxCx14-Mar-07 22:16 
QuestionHow to make Win32 application Singleton? Pin
TurboNext14-Mar-07 5:55
TurboNext14-Mar-07 5:55 
AnswerRe: How to make Win32 application Singleton? Pin
Mark Salsbery14-Mar-07 6:11
Mark Salsbery14-Mar-07 6:11 
GeneralRe: How to make Win32 application Singleton? Pin
Mark Salsbery14-Mar-07 6:45
Mark Salsbery14-Mar-07 6:45 
GeneralRe: How to make Win32 application Singleton? Pin
TurboNext14-Mar-07 6:54
TurboNext14-Mar-07 6:54 
GeneralRe: How to make Win32 application Singleton? Pin
G Haranadh14-Mar-07 8:02
G Haranadh14-Mar-07 8:02 
GeneralRe: How to make Win32 application Singleton? Pin
Mark Salsbery14-Mar-07 8:05
Mark Salsbery14-Mar-07 8:05 
AnswerRe: How to make Win32 application Singleton? Pin
Roger Stoltz14-Mar-07 6:53
Roger Stoltz14-Mar-07 6:53 
AnswerRe: How to make Win32 application Singleton? Pin
Ravi Bhavnani14-Mar-07 9:29
professionalRavi Bhavnani14-Mar-07 9:29 
AnswerRe: How to make Win32 application Singleton? Pin
ThatsAlok14-Mar-07 19:39
ThatsAlok14-Mar-07 19:39 
QuestionLocalisation/Internationalization from Header file Pin
ksrameshkanth14-Mar-07 3:46
ksrameshkanth14-Mar-07 3:46 
QuestionRecent file path length appears to be limited to 30 chars Pin
TClarke14-Mar-07 3:01
TClarke14-Mar-07 3:01 
QuestionCLSID Registry Pin
siddharthsan14-Mar-07 2:44
siddharthsan14-Mar-07 2:44 
AnswerRe: CLSID Registry Pin
ThatsAlok14-Mar-07 19:41
ThatsAlok14-Mar-07 19:41 

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.