There are some things in this question that aren't explicitly specified, so I'm gonna make some assumptions here.
The first assumption i'm making is that the input grayscale image doesn't have a 3 byte RGB value to determine the color of a pixel, instead I assume that for each pixel in the grayscale image, there is only 1 byte specifying what tint it represents in the grayscale.
This, where 0 represents black and 255 represents white.
Because a RGB value for each pixel has 1 byte for the color red, 1 byte for the color green and 1 byte for the color blue (3 bytes total), there is no way of converting the mentioned grayscale image into a RGB image, because there is not enough data for this.
What you could do though, is use the grayscale image tint per pixel, and set this value for all three RGB values. You would still end up with a grayscale image though, but in a different pixel format (RGB).
EDIT: I wrote some code after doing some research about how to solve this, it requires a file C:\image\image1.bmp:
//load input image (bitmap)
Bitmap image1 = new Bitmap(@"C:\image\image1.bmp");
//create output image (bitmap) and set the new pixel format
Bitmap image2 = new Bitmap(image1.Width, image1.Height,
System.Drawing.Imaging.PixelFormat.Format24bppRgb);
//draw the input image on the output image within a specified rectangle (area)
using (Graphics gr = Graphics.FromImage(image2)) {
gr.DrawImage(image1, new Rectangle(0, 0, image2.Width, image2.Height));
}
//save output image
image2.Save(@"C:\image\image2.bmp");