I have managed to export my active vew as a jpeg. It seems to have been a resolution issue. When I run this code in a stand alone application, it works just as expected. However I have a larger project, where I'm opening an existing map, adding a layer then calling the jpeg export function. It's strange but, the jpeg export shows the map prior to the layer being added, even though when I open arcmap manually, the added layer is present on the map. I've been banging my head on this all day.
I'm posting the jpeg export code here should someone find it useful:
IMapDocument mxDoc = new MapDocumentClass();
mxDoc.Open(@"C:\Workspace\test.mxd", "");
IActiveView ActiveView = mxDoc.ActiveView;
System.Int32 screenResolution = 96;
System.Int32 outputResolution = 300;
IExport export = new ExportJPEGClass();
export.Resolution = outputResolution;
export.ExportFileName = @"C:\Workspace\Maps\CodeOut\testout2.jpg";
tagRECT exportRect;
exportRect.left = 0;
exportRect.top = 0;
exportRect.right = 800 *(outputResolution / screenResolution);
exportRect.bottom = 800 * (outputResolution / screenResolution);
IEnvelope envelope = new EnvelopeClass();
envelope.PutCoords(exportRect.left, exportRect.top, exportRect.right, exportRect.bottom);
export.PixelBounds = envelope;
Int32 hDC = export.StartExporting();
ActiveView.Output(hDC, (System.Int16)export.Resolution, ref exportRect, null, null);
export.FinishExporting();
export.Cleanup();