I've written some code that I thought would duplicate an image and allow the second image to be be written to using WRITEPIXEL.
However, both the original image and the "copy" get written to, rather than just the copy. Obviously image1 and image2 are the same image, but why?
What am I doing wrong?
However, both the original image and the "copy" get written to, rather than just the copy. Obviously image1 and image2 are the same image, but why?
Graphics 640,480 Local image=CreateImage(64,64) Local pixmap=LockImage(image) For x=0 To 63 For y=0 To 63 WritePixel(pixmap , x,y , $ffffff00) Next Next Local image2=LoadImage(pixmap) UnlockImage(image) Local pixmap2=LockImage(image2) For n=0 To 100 WritePixel(pixmap2,Rand(0,63),Rand(0,63),$ffff000000) Next UnlockImage(image2) DrawImage image,100,100 DrawImage image2,200,200 Flip WaitKey End
What am I doing wrong?