On Dec 30, 2007, at 2:37 PM, Massimo Valle wrote:
> You can draw the source mask into the target mask, then fillrect the
> source mask with &c000000 to strip the mask and then drawpicture the
> source into the target.
Sounds like it'll work faster than pixel-by-pixel:
Protected Function Part(Source As Picture, X As Integer, Y As Integer,
Width As Integer, Height As Integer) As Picture
dim p as picture
dim x1,y1 as integer
p = newpicture(width,height,32)
for x1 = x to x + (width - 1)
for y1 = y to y + (height - 1)
p.graphics.pixel(x1 - x,y1 - y) = source.graphics.pixel(x1,y1)
next y1
next x1
p.mask.graphics.drawpicture source.mask,
0,0,width,height,x,y,width,height
return p
End Function
--
Thom McGrath
The ZAZ Studios
<http://www.thezaz.com/> AIM: thezazstudios
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|