?
Solved

bitmap from a minimized window

Posted on 1998-04-01
7
Medium Priority
?
210 Views
Last Modified: 2013-12-03
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.
0
Comment
Question by:curtisn
  • 4
  • 3
7 Comments
 

Author Comment

by:curtisn
ID: 1412486
Edited text of question
0
 
LVL 22

Accepted Solution

by:
nietod earned 200 total points
ID: 1412487
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
 
LVL 22

Expert Comment

by:nietod
ID: 1412488
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 22

Expert Comment

by:nietod
ID: 1412489
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
 

Author Comment

by:curtisn
ID: 1412490
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
 
LVL 22

Expert Comment

by:nietod
ID: 1412491
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
 

Author Comment

by:curtisn
ID: 1412492
That works, I will just draw straight to the printerDC, Thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question