|
||
This example is the same like the copyPixels - the diference is, that here is used function merge with random color multipliers.background 255.255.255 bmp_picture: bitmap %bitmaps/holky.jpg exportAssets [bmp_picture "picture"] es: EmptySprite picture: place es doAction [ bmpSource: flash.display.BitmapData.loadBitmap("picture") bmpTarget: make BitmapData! [400 300 false #FFFFFF] picture.attachBitmap(bmpTarget 1) copyPicturePart: func[][ var rx: -30 + random 370 var ry: -30 + random 270 var w: 30 + random 30 var h: 30 + random 30 var srcRectangle: make Rectangle! [(rx) (ry) (rx + w) (ry + h)] var destPoint: make Point! [ (rx + 2 - random 4) (ry + 2 - random 4) ] bmpTarget.merge( bmpSource ;sourceBitmap:BitmapData srcRectangle ;sourceRect:Rectangle destPoint (random 200) ;redMult:Number (random 200) ;greenMult:Number (random 200) ;blueMult:Number 50 ;alphaMult:Number ) ] copyPicturePart() int: setInterval(copyPicturePart 5) ] showFrame end |