Load Bitmap from file to doc
-
Your question is very unclear. What is this document you are talking about ? The document class from an SDI app ? If yes, a document class is not something visible, it is supposed to be data only. Are you talking about the view ? Furthermore, what is this pDC you are using in your code snippet ? Where did you put this code ?
Cédric Moonen Software developer
Charting control [v2.0] OpenGL game tutorial in C++ -
Amin.Abdi wrote:
pDC->BitBlt(1280, -1765, 390, -230, pDC, // pDC : a CDC pointer to document (SDI Program) 0, 0, SRCCOPY);
What is the purpose of bit-blitting from
pDC
topDC
itself?If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
dcMem.SelectObject(&Bitmap);
pDC->BitBlt(1280, nYposChange-1765, 390, -230, &dcMem, 0, 0, SRCCOPY);fixed but still nothing :(
What's the purtpose of a negative height? :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
What's the purtpose of a negative height? :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
And why do you need the following statements?
Amin.Abdi wrote:
BYTE* pBitmapData = new BYTE[ BitmapImageSize ]; ZeroMemory( pBitmapData, BitmapImageSize ); Bitmap.SetBitmapBits(BitmapImageSize, pBitmapData); Bitmap.SetBitmapBits( BitmapImageSize, pBitmapData );
:) The last line is because you don't trust
MFC
? :rolleyes:If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
And why do you need the following statements?
Amin.Abdi wrote:
BYTE* pBitmapData = new BYTE[ BitmapImageSize ]; ZeroMemory( pBitmapData, BitmapImageSize ); Bitmap.SetBitmapBits(BitmapImageSize, pBitmapData); Bitmap.SetBitmapBits( BitmapImageSize, pBitmapData );
:) The last line is because you don't trust
MFC
? :rolleyes:If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]I change my codes : remove that statement and add these:
CClientDC dcMem; dcMem.SelectObject(&Bitmap); pDC->BitBlt(1280, nYposChange-1995, 390, 230, &dcMem, 0, 0, SRCCOPY);
but it show a print screen of window and print nothing. WHY and how can i fix it?
-
I change my codes : remove that statement and add these:
CClientDC dcMem; dcMem.SelectObject(&Bitmap); pDC->BitBlt(1280, nYposChange-1995, 390, 230, &dcMem, 0, 0, SRCCOPY);
but it show a print screen of window and print nothing. WHY and how can i fix it?
You should put your drawing code inside the
CView::OnDraw
method. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
You should put your drawing code inside the
CView::OnDraw
method. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
I would do this test:
CDC memDC;
memDC.CreateCompatibleDC(pDC);
dcMem.SelectObject(&Bitmap);
pDC->BitBlt(0, 0, 390, 230, &dcMem, 0, 0, SRCCOPY);:)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
I would do this test:
CDC memDC;
memDC.CreateCompatibleDC(pDC);
dcMem.SelectObject(&Bitmap);
pDC->BitBlt(0, 0, 390, 230, &dcMem, 0, 0, SRCCOPY);:)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
You are welcome. As about negative height, when you should make something work, I suggest the 'stay simple' principle: start trying with 'fail-proof' parameters and then, when it works a bit, began to change.. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]