bitmap from a minimized window

I am trying to get a full document (that goes beyond the length of the window) and store the document as a bitmap so that I can send it to a device context.  My end goal is to be able to print the document so it looks the same no matter the size or shape of the window containing the document.
curtisnAsked:
Who is Participating?
 
nietodConnect With a Mentor Commented:
You need to create a memory device context.  Create a bitmap of the necessary size and select it into the memory DC. and draw the document into the memory device context.

Do you know any of these steps?
0
 
curtisnAuthor Commented:
Edited text of question
0
 
nietodCommented:
I can give you details (there are a lot of them!).  But now that I think about, I'm not sure that is what you really want.

If you just want to print something, you don't need to create a bitmap.  When you print you have a DC for the printer.  The DC can be used to draw up to an entire page at a time.  Why can't you just draw what you need to the printer DC?
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
nietodCommented:
Perhaps what you really need to do is design you program so that you can "draw" to any DC.  To do this you need to create a single "draw" procedure that takes a DC as a parameter.  When a window needs to be painted, it gets a DC from BeginPaint() and calls your draw procedure.  When you need to print, you get a DC for the printer and call the draw procedure with it.
0
 
curtisnAuthor Commented:
I'm still not sure how to create a bitmap from a window where I can't see the entire desired bitmap.  But I like your comment about printing right to the printerDC,  the original programmer, didn't have any printing functionality And I have been asked to come up with it.  I was thinking using the BitBlt function with a bitmap, Which way do you think is best?
0
 
nietodCommented:
Now that I think about it.  the BitBlt solution makes no sense.  Why?  because to use it you will need to create a memory DC that uses a bitmap the size of the page (That's what I origianlly proposed).  But then you need to draw to that memory DC.  So you still are going to need a procedure for drawing to a DC that is not the window's client areaa DC.  What makes it a bad solution is that after drawing to the memory DC, you must bitblt the image to the printer DC.  Why not just draw to the printer DC in the first place?

Now if you want to know how to create and draw to a bitmap, I can explain it.  But there quite a few steps involved.  However, I don't think that is the best way of handling your problem, at least not with the infornation you have presented so far.  If you have more questions, ask them now.  I am leaving tommorrow morning and will be gone until Tueasday the 7th.
0
 
curtisnAuthor Commented:
That works, I will just draw straight to the printerDC, Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.