Multiply images?

Hi,

I am trying to multiply Two images: One is background( surface) second
-> my image.
I wrote this. But the result isn’t what i need…
I loaded the image by
image = SDL_LoadBMP(…);
And the Video Mode is 800x600x32;

void ObiektGraficzny::Wyswietl1(SDL_Surface *surface, unsigned int a,
unsigned int b) {
int i,j;
int bpp = surface->format->BytesPerPixel;
if (image!=NULL) { // gdy istnieje obrazek to go wyswietl
dst->x=a;
dst->y=b;
src->x=0;
src->y=0;
if (SDL_BlitSurface(image, NULL, surface, dst)<0)
fprintf(stderr,"[ERROR]\n blitting surface\n");
// zablokowac powierzchnie
if ( SDL_MUSTLOCK(surface) )
{
if ( SDL_LockSurface(surface)
< 0 )
{
fprintf(stderr,
"[ERROR]\nNie moge zablokowac ekranu: %s\n", SDL_GetError());
return;
}
}
for(i=0;ih; i++)
for(j=0;j<=image->w; j++)
{
Uint8 *src = (Uint8
*)surface->pixels + i * surface->pitch + j * bpp;
Uint8 *dst = (Uint8
*)image->pixels + i * image->pitch + j * bpp;
(Uint8)src =(( (Uint8)src *
(Uint8)dst )>>8);

                                     *src = (Uint8 *)surface->pixels
  • i * surface->pitch + j * bpp+1;
    *dst = (Uint8 *)image->pixels

  • i * image->pitch + j * bpp+1;
    (Uint8)src =(( (Uint8)src *
    (Uint8)dst )>>8);

                                        *src = (Uint8
    

*)surface->pixels + i * surface->pitch + j * bpp+2;
*dst = (Uint8 *)image->pixels

  • i * image->pitch + j * bpp+2;
    (Uint8)src =(( (Uint8)src *
    (Uint8)dst )>>8);

                                        *src = (Uint8
    

*)surface->pixels + i * surface->pitch + j * bpp+3;
*dst = (Uint8 *)image->pixels

  • i * image->pitch + j * bpp+3;
    (Uint8)src =(( (Uint8)src *
    (Uint8)dst )>>8);

                             }
                                   
                                    
                                if ( SDL_MUSTLOCK(surface) )   {     
    

SDL_UnlockSurface(surface); }
SDL_UpdateRect(surface, a,b,
image->w, image->h);

                             }
                             
 }