Click here to Skip to main content
15,922,894 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: TrackPopupMenu Fails in Thread Pin
Ernest Laurentin17-Dec-01 4:58
Ernest Laurentin17-Dec-01 4:58 
GeneralRe: TrackPopupMenu Fails in Thread Pin
17-Dec-01 8:49
suss17-Dec-01 8:49 
GeneralCalculating sunrise and sunset times Pin
Prashanth Uppunda17-Dec-01 0:48
Prashanth Uppunda17-Dec-01 0:48 
GeneralRe: Calculating sunrise and sunset times Pin
Eugene Pustovoyt17-Dec-01 1:28
Eugene Pustovoyt17-Dec-01 1:28 
GeneralMultithread UDP Server using AsyncSocket Pin
dunkhong17-Dec-01 0:07
dunkhong17-Dec-01 0:07 
QuestionNIC information? Pin
16-Dec-01 22:59
suss16-Dec-01 22:59 
AnswerRe: NIC information? Pin
Joaquín M López Muñoz16-Dec-01 23:16
Joaquín M López Muñoz16-Dec-01 23:16 
Generalsecurity of .ocx Pin
marutis16-Dec-01 19:01
marutis16-Dec-01 19:01 
Generalstatic data member in MFC program Pin
Dave K Dosanjh16-Dec-01 16:28
Dave K Dosanjh16-Dec-01 16:28 
GeneralRe: static data member in MFC program Pin
Christian Graus16-Dec-01 16:47
protectorChristian Graus16-Dec-01 16:47 
QuestionHow can I print a bitmap file ? Pin
16-Dec-01 15:31
suss16-Dec-01 15:31 
AnswerRe: How can I print a bitmap file ? Pin
Christian Graus16-Dec-01 15:51
protectorChristian Graus16-Dec-01 15:51 
GeneralRe: How can I print a bitmap file ? Pin
Chambers17-Dec-01 7:56
Chambers17-Dec-01 7:56 
GeneralRe: How can I print a bitmap file ? Pin
Christian Graus17-Dec-01 10:15
protectorChristian Graus17-Dec-01 10:15 
GeneralRe: How can I print a bitmap file ? Pin
Chambers18-Dec-01 0:42
Chambers18-Dec-01 0:42 
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 

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.