ID:122538
 
Redundant
Applies to:DM Language
Status: Redundant

This feature has already been implemented, or is already achievable with existing methods.
Considering we have DrawBox and GetPixel... I was hoping for a PixelCopy() function. Essentially you would provide the procedure with two icons, two pixel locations, and optional icon_states / animation frames. It would copy one pixel from source icon to a pixel in destination icon. Maybe even expand this to receive a range of pixels to copy. This could allow for some very interesting real-time image editing applications for people who like to design their own development environment with the DM language.

I have tried to write this function my self with no success. Perhaps something is off about passing icons or their pointers to and from global procs... I am not sure. The only way I have been able to make this type of thing work is to create a blank icon and copy the pixels to it immediately afterwards in the same procedure. Passing icons into a global proc causes the image to be lost.
In-place image editing (like a DM-based editor that is) is really never going to work that great anyway, so putting features toward that would be a waste of time. I do see value in doing a copy from one rectangle to another, but this is already possible via soft code:

1) Use DrawBox() in icon A to clear out the destination rectangle.
2) Make a copy of icon B.
3) Use DrawBox() up to four times on B' to clear out around the source rectangle.
4) Blend() B' onto A using ICON_OVERLAY.
I wasn't asking for photoshop hehe, but I would like to be able to copy a range of pixels without having to destroy the image, or re-build it from the ground up with so many copies of icons made in memory.
The approach I outlined would only involve making an /icon version of A, assuming it already isn't one, and making a temporary copy of icon B. Making A into an /icon datum would be required either way and copying B is very low overhead--especially considering B would often be just one frame.