Results 1 to 22 of 22

Thread: How to draw quality images in C++

Threaded View

  1. #1

    Thread Starter
    Frenzied Member aewarnick's Avatar
    Join Date
    Dec 2002
    Posts
    1,037

    How to draw quality images in C++

    In my C++ to C# test post I mention that the test is not fair yet because the C# app draws much better images than the C++ app.

    Here is the code that does the drawing:
    Code:
    HBITMAP hOldMemBmp= (HBITMAP)::SelectObject(imageDC, hBmp);
    a::hOldBmp= (HBITMAP)::SelectObject(a::hdcMem, hMemBmp);
    
    ::StretchBlt(a::hdcMem, 0, 0, wndRect.right-wndRect.left,
        wndRect.bottom-wndRect.top, imageDC, 0, 0, BmpW, BmpH, SRCCOPY);
    
    ::BitBlt(a::hdcMem, drawLocation->left, drawLocation->top, drawLocation->right - drawLocation->left,
        drawLocation->bottom - drawLocation->top, imageDC, 0, 0, SRCCOPY);
    
    ::BitBlt(hDC, invalLocation->left, invalLocation->top,
        invalLocation->right-invalLocation->left,
        invalLocation->bottom-invalLocation->top, a::hdcMem, invalLocation->left, invalLocation->top, SRCCOPY);
    I read about using SetStretchMode(HALFTONE); but it doesn't work on win98.
    How would I draw/stretch an image as nice as C# does another way?
    Last edited by aewarnick; Jul 19th, 2003 at 09:28 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width