Hello Everyone,
I recently came up with a really nice little piece of code that allows me to merge images quickly (by merging I mean fade in and out). The only problem is, the tests worked fine on small scale (like small images), but once I started to go larger, my resources quickly become consumed and this nice little process wasn't so nice anymore
Anyway, to do this index through two byte arrays, and merge them, which some math, and add them to a list. This is currently how I perform the task
for (int i = 0; i < FrontImageBytes.Count; i++)
{
NewImage.Add((byte) (((int) (FrontPercent * FrontImageBytes [i])) + ((int) (BackPercent * BackImageBytes [i]))));
}
Again this works fine on small scale, but one in large scale, it's horrible.
My question to you then is how can I improve the performance of indexing through two byte arrays, merging them while applying my math formula to them? I am thinking something along streams, but I have no clue.
Hope this makes sense (kind of whipped this up as I am in a hurry)