buffer.
I like the first sun ray in the morning.
"Joseph M. Newcomer"???
That's a scary concept: a hardwired number for a picture size! What is
stranger is that
76800 is not the same as 256*360 (which my calculator claims is 92160).
See my MVP Tips site where I show some code that draws images, loosely
based on some of
the MSDN documentation.
You don't "print" to a screen; you "draw" to a screen; you "print" to a
piece of paper,
and for bitmaps it is trickier to get the bitmap to print on paper than
to draw it on the
screen.
Now there is another question: why are you drawing using a CClientDC?
You should have all
this drawing code in the OnPaint handler, and be using CPaintDC.
Otherwise, it is likely
that your image is simply being erased as part of the OnEraseBgnd
handler. So the part 2
is VERY suspicious code. Note that when you post code like this, it is
insufficient to
give code snippets like this; you have to say WHERE the code is found.
joe
On Sun, 11 Jun 2006 17:56:01 -0700, Leo.Net
<LeoNet@discussions.microsoft.com> wrote:
Hello!
There is an array in which data of a grey picture is stored : BYTE
OrigData[76800];
How can I print it on screen using MFC or whatever C++(C++.Net or
something)????
I have tried, but failed
/* part 1*/
CBitmap bmp;
bmp.CreateBitmap(256, 360, 1, 8, (const void*)OrigData);
BITMAP bm;
bmpFinger.GetBitmap(&bm);
/* part 2*/
CDC MemDC;
CClientDC dc(this);
MemDC.CreateCompatibleDC(&dc);
MemDC.SelectObject(bmp);
dc.BitBlt(50, 50, bm.bmWidth , bm.bmHeight, &MemDC, 0, 0, SRCCOPY);
But, nothing is on the screen. And,unexpectedly, bm.bmBits !=
OrigData
In addition, I am sure part2 is correct.
Help me! Thanks very much.
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm