Ok, I'm going snow-blind trying to find my mistake. A while back I wrote a simple little pixelart editor and decided to convert it over to Lazarus so I can use it on my Mac, Linux, and PC systems.

All was going well until I decided to "optimize" the graphics by creating my own layered image support. This works a treat and is MUCH faster then using per pixel manip via the LCL.

The problem is when I try and load an existing image from my HD using TPicture, TGraphic, TBitmap, whatever it all goes across the gap and I get errors in strange places.

This leads me to believe that I've screwed up and am either overriding memory some place, or have a memory leak some place that isn't so obvious.

If anyone can look at the source and tell me where/what I'm doing wrong I'd really appreciate it.

Download http://www.eonclash.com/PGD/ImageEditor.zip

PS: This is only the start of the conversion, lots more work to be completed before I'm done. I know the code is a mess and once I have this part working I'm going to start cleaning it up. This requires a version of Lazarus that has "frame" support to compile.