F# lazy pixels reading
问题 I want to make a lazy loading of image pixels to the 3 dimensional array of integers. For example in simple way it looks like this: for i=0 to Width for j=0 to Height let point=image.GetPixel(i,j) pixels.[0,i,j] <- point.R pixels.[1,i,j] <- point.G pixels.[2,i,j] <- point.B How it can be made in lazy way? 回答1: What would be slow is the call to GetPixel . If you want to call it only as needed, you could use something like this: open System.Drawing let lazyPixels (image:Bitmap) = let Width =