<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body>Chris,<BR>
<BR>
Thanks for the reply, I am NOT avoiding the overlapping -- I just want the particle-images to be overlapped naturally. That is, at each overlapping region, the pixel values of one of the particle-images must overwrite (NOT be added to) the pixel values of the other particle-image. Pasting does the job, however, it also overwrites the black background of each square-shaped particle-image (notice the square edges in the overlapping areas in the sample <A href="http://img81.imageshack.us/my.php?image=testyz7.png">http://img81.imageshack.us/my.php?image=testyz7.png</A>).<BR><BR><BR>> <BR>> > I am trying to simulate an image like this:<BR>> > <BR>> > http://ftp.sv.vt.edu/pub/projects97/pvlachos/pvlachos_project/images/piv.gif<BR>> > <BR>> > I started with creating small sized GaussianImageSource instances and pasting them at random positions on a background using PasteImageFilter. The problem is when two GaussianImageSource overlap as it can be seen in thios sample: http://img81.imageshack.us/my.php?image=testyz7.png<BR>> > <BR>> > (2) If not, how to get rid of the ovelaping problem?<BR>> <BR>> First thing that fell into my head:<BR>> You could <BR>> instantiate an int/bool array[][] img with your image size. Everytime you <BR>> paste to some location (x,y) you set img[x][y] = 1/true. (also set all <BR>> pixels covered by this image). Next time you want to paste to the image <BR>> check the pixels you are going to paste into to se if there is an image <BR>> there alredy. If there is, choose a new one.<BR>> <BR>> As the number of places a new image fits in the larger image the <BR>> while(find_a_suitable_place) loop may take some time. I am sure you can <BR>> come up with something clever to speed this up.<BR>> <BR>> Example: <BR>> If your small images are 10x10 and you past to (0,0) you set <BR>> img[0..10][0..10] = 1. <BR>> If you try to paste the next small image to (2,2) (i guess you use a <BR>> random-function for this) you check img[2..12][2..12]. Since these are not <BR>> 0 you must search for a new location.<BR>> <BR>> Christian.<BR>> <BR><BR><br /><hr />Be one of the first to try <a href='http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d' target='_new'>Windows Live Mail.</a></body>
</html>