bitblt

This is a discussion on bitblt within the Windows Programming forums, part of the Platform Specific Boards category; Im having trouble with bitblt I can get it to display an image but I call bitblt again in a ...

  1. #1
    Registered User canine's Avatar
    Join Date
    Sep 2001
    Posts
    125

    bitblt

    Im having trouble with bitblt
    I can get it to display an image but I call bitblt again in a different placeit dosent create it.
    I am trying to have an image move around the screen.
    Also how do you make a window un resizeable and un maximizable?
    Thanx in advanced
    In a perfect world every dog would have a home and every home would have a dog.
    Visit My Web Site, Canine Programming
    I use Win32 API

  2. #2
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,856
    What does GetLastError() report?
    What are the values in the BitBlt() call?
    Are you using a framebuffer system?

    To make a window stay a constant size try
    Code:
    case WM_MOVING:
    case WM_SIZING://these are sent AS the user changes them 
    //replace the new coods with the previously captured Screen Coods (GetWindowRect() in WM_INIT / WM_CREATE)
    ((RECT*)lParam)->left=rScreenRect.left;
    ((RECT*)lParam)->right=rScreenRect.right;
    ((RECT*)lParam)->top=rScreenRect.top;
    ((RECT*)lParam)->bottom=rScreenRect.bottom;
    break;
    then return the msg to defwinproc function (or DefMDIChildProc())
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  3. #3
    Registered User canine's Avatar
    Join Date
    Sep 2001
    Posts
    125
    uh well I have no ide about the framebuffer;How do you use GetLastError;and I am calling bitblt as simple as possible with just normal coords and hdcs from get compattiblehdc,gethdc, and I just found the width and hight.
    In a perfect world every dog would have a home and every home would have a dog.
    Visit My Web Site, Canine Programming
    I use Win32 API

  4. #4
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,856
    All the values seem correct?
    No NULL HDC's or -ve coods? (or coods off the image)
    Have not wiped the HDC or BMP?

    Code:
    if(!BitBlt(Blah, blah,.....))
    {
        iError=GetLastError();
        sprintf(sBuffer,"BitBlt failed with error %d.", iError);
        MessageBox(hWnd,sBuffer,"App Error",MB_OK|MB_ICONERROR);
    }
    Look the error up in the help

    0 = error success (you don't want to see this)
    87 = incorrect param
    ect

    You are Being very careful with your GDI memory? ReleaseDC() any GetDC() and DeleteObject() any CreateXX()'s (not while selected into a DC)
    Last edited by novacain; 07-10-2002 at 12:20 AM.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. BitBlt()
    By Gordon in forum Windows Programming
    Replies: 2
    Last Post: 05-29-2008, 12:38 AM
  2. Which BitBlt Raster Op?
    By SMurf in forum Windows Programming
    Replies: 1
    Last Post: 03-01-2006, 12:52 PM
  3. another BitBlt question..
    By btq in forum Windows Programming
    Replies: 6
    Last Post: 10-11-2002, 04:28 PM
  4. BitBlt and vertical retrace
    By Magos in forum Windows Programming
    Replies: 1
    Last Post: 06-15-2002, 02:32 PM
  5. Problems with BitBlt
    By Isometric in forum Windows Programming
    Replies: 6
    Last Post: 02-05-2002, 08:20 PM

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