GoIconicNode with metafiles as Image

In my application I have descendends of GoIconicNode, where the images are System.Drawing.Imaging.Metafile.
I have implemented the Cut/Copy/Paste functionality and it looks like my metafiles are transformed into bitmaps after Paste.
Is this a known bug or do you think I am doing something wrong ?

I’m surprised. I don’t recall ever hearing about such behavior.
Copying (actually serializing and deserializing) does not copy the image data, so the copied GoImage that is the Icon of your GoIconicNode just has the same GoImage.Name and GoImage.Index as the original GoImage does.
That information is used by GoImage.LoadImage() to get a System.Drawing.Image in exactly the same manner as the original GoImage did.
I don’t suppose you have changed the value of GoView.InterpolationMode, have you?

I don’t use ImageLists, nor ResurceManagers, I just set the node.Image.Image to images produced at runtime, which are after that saved into a database.
On copy/paste the image is lost, that’s why I made a memeber of type Image in my class to ‘save’ the images. Then I do node.Image.Image = mySavedImage in CopyChildren. (I really forgot this when I posted before, sorry)
This member is changing from metafile to bitmap during copy/paste.
I still don’t know why, but I will dig further. Thanks for your quick answer, it helped me remember my own code.

I made an experiment: put a “System.Drawing.Imaging.Metafile” on clipboard and took it back. The result is not vectorial anymore (ImageType is now Bitmap and the pixels are visible).
So, I think this is another .net problem concerning metafiles and clipboard.
Anyway, I gave up maintaining that Image member. I replaced it with an array of bytes (which does not get corrupt through the clipboard) and solved the problem.
Thanks for your time and good luck!

Yes, that makes sense.
GoDiagram was designed so that you could override GoImage.LoadImage in order to recover the System.Windows.Forms.Image given the Name, Index, and any other easily serializable state that you may have added to your class inheriting from GoImage. That way the pasted copy could get the Image from the original source, and would permit the sharing of that data.
By always copying the image data (bytes), you make the ability to share Images more difficult and you may increase the memory usage/serialization bandwidth requirements. But for small images that might not be a big deal.
By the way, CopyObject for a GoImage does share the Image reference, so you shouldn’t need to override CopyObject (or do the assignment in CopyChildren of your node class). It’s just that that Image reference is [NonSerialized].