bitblt problem
-
Hi All, i have a problem with the MFC function of the class CDC: BOOL BitBlt( int x, int y, int nWidth, int nHeight, CDC* pSrcDC, int xSrc, int ySrc, DWORD dwRop ) When i use it for copy a bitmap with an area (in logic coordinates) minor than 8840000 (es. nWidth=5200 e nHeight=1700) it works properly, but with a major value it seems doesn't copy anything and the copy of the original bitmap is completely black. This bitmap resulting by the copy is already set to black previously when i use the function CBitmap::CreateCompatibleBitmap ... so i say that the BitBlt doesn't have any effect in this case.... Did you know why it happens?? Did you know some others MFC functions for doing the copy of bitmaps?? I hope i was enought clear to explain the problem. I'm sorry if it was already post but i didn't found it. Thanks in advantage for any help Bye TM
-
Hi All, i have a problem with the MFC function of the class CDC: BOOL BitBlt( int x, int y, int nWidth, int nHeight, CDC* pSrcDC, int xSrc, int ySrc, DWORD dwRop ) When i use it for copy a bitmap with an area (in logic coordinates) minor than 8840000 (es. nWidth=5200 e nHeight=1700) it works properly, but with a major value it seems doesn't copy anything and the copy of the original bitmap is completely black. This bitmap resulting by the copy is already set to black previously when i use the function CBitmap::CreateCompatibleBitmap ... so i say that the BitBlt doesn't have any effect in this case.... Did you know why it happens?? Did you know some others MFC functions for doing the copy of bitmaps?? I hope i was enought clear to explain the problem. I'm sorry if it was already post but i didn't found it. Thanks in advantage for any help Bye TM
Have you taken a look into StrechBlt (...) ?? Maybe your problem is because the sizes are not matching and the BitBlt doesn't know how to do it with that parameters.
Greetings. -------- M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you “The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
-
Hi All, i have a problem with the MFC function of the class CDC: BOOL BitBlt( int x, int y, int nWidth, int nHeight, CDC* pSrcDC, int xSrc, int ySrc, DWORD dwRop ) When i use it for copy a bitmap with an area (in logic coordinates) minor than 8840000 (es. nWidth=5200 e nHeight=1700) it works properly, but with a major value it seems doesn't copy anything and the copy of the original bitmap is completely black. This bitmap resulting by the copy is already set to black previously when i use the function CBitmap::CreateCompatibleBitmap ... so i say that the BitBlt doesn't have any effect in this case.... Did you know why it happens?? Did you know some others MFC functions for doing the copy of bitmaps?? I hope i was enought clear to explain the problem. I'm sorry if it was already post but i didn't found it. Thanks in advantage for any help Bye TM
Tommaso Maggioli wrote:
BOOL BitBlt( int x, int y, int nWidth, int nHeight, CDC* pSrcDC,
How your are selecting the bitmap in pSrcDC and in which DC you are coping?.. It will be clear if you post your code little bit...
Do your Duty and Don't expect the Result
-
Tommaso Maggioli wrote:
BOOL BitBlt( int x, int y, int nWidth, int nHeight, CDC* pSrcDC,
How your are selecting the bitmap in pSrcDC and in which DC you are coping?.. It will be clear if you post your code little bit...
Do your Duty and Don't expect the Result
I use the function BitBlt in this way:
... ... /** caller*/ pPGMBitmap->copyTo (CpyBitmapDisplay.GetDC(), 0, 0, BMPSize.cx, BMPSize.cy, 0, 0); ... ... ... ... /** handler*/ void CBitmapDisplay::copyTo(CDC *pdc, int xDest, int yDest, int w, int h, int xSrc, int ySrc) { if(pdc && hDC_.GetSafeHdc() != 0) pdc->BitBlt(xDest, yDest, w,h, &hDC_, xSrc, ySrc, SRCCOPY); } ... ...
where &hDC is a CDC object of the class CBitmapDisplay.... Thanks TM -
Hi All, i have a problem with the MFC function of the class CDC: BOOL BitBlt( int x, int y, int nWidth, int nHeight, CDC* pSrcDC, int xSrc, int ySrc, DWORD dwRop ) When i use it for copy a bitmap with an area (in logic coordinates) minor than 8840000 (es. nWidth=5200 e nHeight=1700) it works properly, but with a major value it seems doesn't copy anything and the copy of the original bitmap is completely black. This bitmap resulting by the copy is already set to black previously when i use the function CBitmap::CreateCompatibleBitmap ... so i say that the BitBlt doesn't have any effect in this case.... Did you know why it happens?? Did you know some others MFC functions for doing the copy of bitmaps?? I hope i was enought clear to explain the problem. I'm sorry if it was already post but i didn't found it. Thanks in advantage for any help Bye TM
Is BitBlt returning FALSE? If so, what does GetLastError() return? Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Is BitBlt returning FALSE? If so, what does GetLastError() return? Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
I'm sorry but i see only now that the bitblt operate perfectly and the problem is another.... :doh: Thanks to All, TM
Don't need to apologise, many times errors are not where we think ;) It is good if you have solved it
Greetings. -------- M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you “The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson