Question

i have been trying to change colors on a wmf canvas in Delphi, with usual images i just run a scanline or by running a loop on each X and Y pixel and give it a new color code, but with MetaCanvas this method doesnt work, maybe because it is not actually an image but instead a list of GDI functions. I read somewhere that i would need to decompile and recompile the metafile for changing color properties in it. But i dont have a clue how i will do it or if there is another easy way for it.

If anyone can point me in the right direction.

Thanks

Was it helpful?

Solution

There is a mechanism for you to modify the contents of a meta file.

Call EnumEnhMetaFile passing a callback function, EnhMetaFileProc. The callback function is called for each record in the metafile. You can take a copy of this record, modify it, and then pass it to PlayEnhMetaFileRecord.

So, you could look for records that specified colours, and make whatever modifications you need.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top