Sign in to follow this  

Win32 api, C++ and smeared images while blitting

This topic is 4094 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am getting smired images when they move on the screen. Any one know how to fix that issue?
 case WM_PAINT://the window needs repainting
        {
			

HANDLE       hOld;
HDC          hdc;
            //a variable needed for painting information
            PAINTSTRUCT ps;
           


			
            //start painting
            hdc=BeginPaint(hWndMain,&ps);
    
    
            //redraw the map
           BitBlt(hdc,0,0,
                   640,
                  480,
                   bmoMap,
                   0,0,
                   SRCCOPY);
		 //  InvalidateRect(hWndMain,NULL,FALSE);
                 
ReleaseDC(hWndMain,hdc);

            //end painting
            EndPaint(hWndMain,&ps);
					
            //handled message, so return 0
            return(0);
        }break;




void DrawMap()//draw screen
{
	//place the toolbar
//mask first
BitBlt(bmoMap,640,0,640,480,bmoMap,0,0,SRCAND);
//then image
BitBlt(bmoMap,640,480,640,480,bmoMap,0,0,SRCCOPY);

    bmoBall.Load(NULL,"ball.bmp");
    bmoback.Load(NULL,"ballmask.bmp");
    
 
 // blits a transpairent image to the screen
 BitBlt(bmoMap,Ball.x ,Ball.y,70,70,bmoback,0,0,SRCAND);
 BitBlt(bmoMap,Ball.x,Ball.y,70,70,bmoBall,0,0,SRCPAINT);
 

Paddlemove(Paddle.px,Paddle.py);

Share this post


Link to post
Share on other sites
I would look into the mask your using for the transparency. Instead of using a mask, look into TransparentBitBlt(). Just add this into your WinMain.h (or your defines header file): #pragma comment(lib, "msimg32.lib") and that will get TransparentBitBlt() it work.

[Edited by - LostSource on October 3, 2006 12:31:39 AM]

Share this post


Link to post
Share on other sites

This topic is 4094 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this