Bitmap

This is a discussion on Bitmap within the Windows Programming forums, part of the Platform Specific Boards category; Ok, i am using the following code to put a bitmap. pDC->StretchBlt(m_rcPosition.left, m_rcPosition.top, m_rcPosition.Width(), m_rcPosition.Height(), &dcMem, 0, 0, bmInfo.bmWidth, bmInfo.bmHeight, ...

  1. #1
    Mr Ed
    Guest

    Bitmap

    Ok, i am using the following code to put a bitmap.


    pDC->StretchBlt(m_rcPosition.left, m_rcPosition.top,
    m_rcPosition.Width(), m_rcPosition.Height(),
    &dcMem, 0, 0, bmInfo.bmWidth, bmInfo.bmHeight, SRCAND);



    Now what happens is the bitmaps comes on the screen in the user selected rectangle, After the user has released the LButton.

    I would like that bitmap be displayed while user is selecting the region, so user can properly set the size. That is bitmap be displayed in the rubber band box.

    win98 vc6

  2. #2
    Normal vector Carlos's Avatar
    Join Date
    Sep 2001
    Location
    Budapest
    Posts
    463
    Well, do the stretching (StretchBlt) to the CompatibleDC, then copy the CompatibleDC with BitBlt to the DisplayDC.
    Using WinAPI:

    StretchBlt( hdcScaled,
    0, 0,
    bmInfo.bmWidth * SCALE_FACTOR_X, bmInfo.bmHeight * SCALE_FACTOR_Y,
    dcSource, // a compatible DC wich contains the original image
    0, 0,
    bmInfo.bmWidth, bmInfo.bmHeight,
    SRCCOPY );

    BitBlt( hdcWin, // your display DC
    0,0,
    bmInfo.bmWidth, bmInfo.bmHeight,
    hdcScaled,
    0,0,
    SRCCOPY );

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Loading a bitmap (Without using glaux)
    By Shamino in forum Game Programming
    Replies: 7
    Last Post: 03-16-2006, 08:43 AM
  2. OpenGL -- Bitmaps
    By HQSneaker in forum Game Programming
    Replies: 14
    Last Post: 09-06-2004, 04:04 PM
  3. Loading a Bitmap resource for OpenGL Texture[x]
    By the dead tree in forum Game Programming
    Replies: 4
    Last Post: 08-26-2004, 01:12 PM
  4. bitmap not going onto screen
    By stallion in forum Windows Programming
    Replies: 4
    Last Post: 02-22-2003, 09:07 AM
  5. texture is all white in opengl!
    By Crossbow in forum Game Programming
    Replies: 7
    Last Post: 03-31-2002, 10:54 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21