Click here to Skip to main content
15,906,094 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How can I print a bitmap file ? Pin
Christian Graus18-Dec-01 10:04
protectorChristian Graus18-Dec-01 10:04 
GeneralRe: How can I print a bitmap file ? Pin
manio18-Dec-01 18:32
manio18-Dec-01 18:32 
GeneralRe: How can I print a bitmap file ? Pin
Christian Graus18-Dec-01 18:50
protectorChristian Graus18-Dec-01 18:50 
GeneralRe: How can I print a bitmap file ? Pin
18-Dec-01 20:53
suss18-Dec-01 20:53 
GeneralRe: How can I print a bitmap file ? Pin
Christian Graus19-Dec-01 1:02
protectorChristian Graus19-Dec-01 1:02 
GeneralRe: How can I print a bitmap file ? Pin
manio21-Dec-01 0:44
manio21-Dec-01 0:44 
GeneralRe: How can I print a bitmap file ? Pin
Christian Graus21-Dec-01 0:55
protectorChristian Graus21-Dec-01 0:55 
GeneralRe: How can I print a bitmap file ? Pin
manio21-Dec-01 0:02
manio21-Dec-01 0:02 
Christian,

One more question about StretchBlt..

suppose my bitmap data to be printed is in some buffer like this:
pCurrentImage, (i.e, as the following
class CRGBImage
{
public:
BYTE* data;
int m_nWidth; // in pixel
int m_nHeight;
};

Now I already get something like this: CRGBImage* pCurrentImage...
Then I want to print this image data, so I wrote the following codes.

CPrintDialog dlg( FALSE );
CDC dc;
dc.Attach( dlg.GetPrinterDC() );

//calculate printing area(width and height)
int pwidth = dc.GetDeviceCaps(HORZRES);//get width of printing area
int pheight = dc.GetDeviceCaps(VERTRES);//get height of printing area

Now, how can I copy my bitmap data to dc ?
And, for the following StretchBlt API:

BOOL CDC::StretchBlt( int x, int y, int nWidth, int nHeight, CDC* pSrcDC, int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, DWORD dwRop );

(Take the width for example)
The above parameter nSrcWidth = pCurrentImage->m_nWidth, right ?

And, how about the nWidth ? How to calculate it if I want to print to the original dimension of my bitmap ?

How to calculate pSrcDC ? (Do I just use: dc.StretchBlt(...) as dc mentioned above ? Because there are 2 DCs, I got kind of confused !! )

And, when to put "COLORONCOLOR StretchBlt mode" as you mentioned last time ?

I know I probably asked too many questions. Your any reply would be greatly appreciated..
Smile | :)
GeneralRe: How can I print a bitmap file ? Pin
Christian Graus21-Dec-01 0:51
protectorChristian Graus21-Dec-01 0:51 
Questionwhy no need to declare class CXXXDoc in XXXView.h? Pin
AnonymousBabe@usa.net16-Dec-01 15:15
AnonymousBabe@usa.net16-Dec-01 15:15 
AnswerRe: why no need to declare class CXXXDoc in XXXView.h? Pin
Erik Funkenbusch17-Dec-01 0:00
Erik Funkenbusch17-Dec-01 0:00 
GeneralProgram not starting Pin
16-Dec-01 10:37
suss16-Dec-01 10:37 
GeneralRe: Program not starting Pin
Paul Selormey16-Dec-01 13:08
Paul Selormey16-Dec-01 13:08 
GeneralRe: Program not starting Pin
Lim Bio Liong16-Dec-01 19:36
Lim Bio Liong16-Dec-01 19:36 
GeneralRe: Program not starting Pin
Jon Hulatt17-Dec-01 0:04
Jon Hulatt17-Dec-01 0:04 
GeneralRe: Program not starting Pin
Rickard Andersson2017-Dec-01 0:38
Rickard Andersson2017-Dec-01 0:38 
GeneralRe: Program not starting Pin
Michael P Butler17-Dec-01 1:09
Michael P Butler17-Dec-01 1:09 
GeneralRe: Program not starting Pin
17-Dec-01 2:14
suss17-Dec-01 2:14 
GeneralRe: Program not starting Pin
Michael P Butler17-Dec-01 2:48
Michael P Butler17-Dec-01 2:48 
GeneralRe: Program not starting Pin
17-Dec-01 5:31
suss17-Dec-01 5:31 
GeneralCUIntArray & CList Pin
16-Dec-01 8:40
suss16-Dec-01 8:40 
GeneralRe: CUIntArray & CList Pin
Michael Dunn16-Dec-01 9:00
sitebuilderMichael Dunn16-Dec-01 9:00 
GeneralRe: CUIntArray & CList where the error is Pin
16-Dec-01 9:40
suss16-Dec-01 9:40 
GeneralRe: CUIntArray & CList where the error is Pin
16-Dec-01 10:05
suss16-Dec-01 10:05 
GeneralOLE container ambient properties Pin
Paul S16-Dec-01 6:33
Paul S16-Dec-01 6:33 

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.