rebol [ title: "FLASH8 - Copy pixels" type: 'swf8 file: %swf8-copypixels.swf background: 255.255.255 rate: 24 size: 400x300 author: "Oldes" email: oliva.david@seznam.cz date: 19-10-2005 purpose: {Simple example how to use function copyPixels (fast routine to perform pixel manipulation between images with no stretching, rotation, or color effects).} comment: {} compressed: true ] 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 + 5 - random 10) (ry + 5 - random 10) ] bmpTarget.copyPixels( bmpSource ;sourceBitmap:BitmapData srcRectangle ;sourceRect:Rectangle destPoint ) ] copyPicturePart() int: setInterval(copyPicturePart 10) ] showFrame end