Solved

bitmap from a minimized window

Posted on 1998-04-01
7
192 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 50 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
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…

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now