Hi,
In c# your looking at something like bellow, personally I would write a Xaml file as then you could use tags for Red Green Blue. Looping through the image is the only option do not write as you get the pixel data as this will slow your program down since writing to your disc is relatively slow.
You could always use 4 lists one for top, bottom, left and right if you wish to keep the points separate. Alternatively positions [0 to (myImage.Width-1)] will be the top. [(myImage.Width-1) to (myImage.Width-1)+(myImage.Width-1)] will be the bottom and so on...
Bitmap my_new_image = new Bitmap(original_image.Width, original_image.Height);
List<color> my_colour_list = new List<colour>();
for (int x = 0; x < myImage.Width; x++)
{
my_colour_list.Add(output_data.GetPixel(x, 0))
}
for (int x = 0; x < myImage.Width; x++)
{
my_colour_list.Add(output_data.GetPixel(x, myImage.Height))
}
for (int y = 0; y < myImage.Height; y++)
{
my_colour_list.Add(output_data.GetPixel(0, y))
}
for (int y = 0; y < myImage.Height; y++)
{
my_colour_list.Add(output_data.GetPixel(myImage.Width, y))
}
System.IO.StreamWriter file_to_write = new System.IO.StreamWriter("c:\\test.txt");
foreach(Color var in my_colour_list)
{
file_to_write.WriteLine(var.toString());
file_to_write.WriteLine(var.R.toString());
file_to_write.WriteLine(var.R.toString());
file_to_write.WriteLine(var.R.toString());
}</colour></color>
Hope this helps,
Cheers,
Chris