Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure Toperations.Timer1Timer(Sender: TObject);
- var
- Sprite,Mask,Buffer:Tbitmap;
- begin
- SetImage('FON',ImageFon);
- Sprite:=Tbitmap.Create;
- Buffer:=Tbitmap.Create;
- Mask:=Tbitmap.Create;
- Sprite.LoadFromResourceName(HInstance, 'Bitmap_b64');
- Mask.LoadFromResourceName(HInstance, 'Bitmap_b64');
- //
- Mask.Height:=Sprite.Height-y1;
- Mask.Width:=Sprite.Width-x1;
- Buffer.Height:=Sprite.Height-y1;
- Buffer.Width:=Sprite.Width-x1;
- //изменение размера
- SetStretchBltMode(Buffer.Canvas.Handle, HALFTONE);
- StretchBlt(Mask.Canvas.Handle, 0, 0, Sprite.Width-x1, Sprite.Height-y1, Sprite.Canvas.Handle, 0, 0, Sprite.Width, Sprite.Height, SRCCOPY);
- StretchBlt(Buffer.Canvas.Handle, 0, 0, Sprite.Width-x1, Sprite.Height-y1, Sprite.Canvas.Handle, 0, 0, Sprite.Width, Sprite.Height, SRCCOPY);
- //вывод
- SetStretchBltMode(Buffer.Canvas.Handle, BLACKONWHITE);
- SetStretchBltMode(Buffer.Canvas.Handle, COLORONCOLOR);
- //SetStretchBltMode(Buffer.Canvas.Handle, WHITEONBLACK);
- Mask.Mask(clBlack);
- MaskBlt(ImageFon.Picture.Bitmap.Canvas.Handle,FLEFT, FTOP, Buffer.Width, Buffer.Height, Buffer.Canvas.Handle,0,0,Mask.MaskHandle,0,0,SRCPAINT);
- BitBlt(ImageFon.Picture.Bitmap.Canvas.Handle, FLEFT, FTOP, Buffer.Width, Buffer.Height, Buffer.Canvas.Handle,0,0, SRCPAINT);
- FTOP:=FTOP-3;
- FLEFT:=FLEFT+8;
- inc(x1);
- inc(y1);
- FreeAndNil(Mask);
- FreeAndNil(Sprite);
- FreeAndNil(Buffer);
- if (x1>15) then begin
- Timer1.Enabled:=False;
- SetImage('FON',ImageFon);
- Sprite:=Tbitmap.Create;
- Mask:=Tbitmap.Create;
- Sprite.LoadFromResourceName(HInstance, 'Bitmap_b48');
- Mask.LoadFromResourceName(HInstance, 'Bitmap_b48');
- //
- Mask.Height:=Sprite.Height;
- Mask.Width:=Sprite.Width;
- Mask.Mask(clBlack);
- MaskBlt(ImageFon.Picture.Bitmap.Canvas.Handle, FLEFT,FTOP, Sprite.Width, Sprite.Height, Sprite.Canvas.Handle,0,0,Mask.MaskHandle,0,0,SRCPAINT);
- BitBlt(ImageFon.Picture.Bitmap.Canvas.Handle, FLEFT, FTOP, Sprite.Width, Sprite.Height, Sprite.Canvas.Handle,0,0, SRCPAINT);
- FreeAndNil(Mask);
- FreeAndNil(Sprite);
- Sleep(500);
- Timer2.Enabled:=True;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement