2008-09-13, 12:31 AM
The code to create a jpg from the GetRenderList works fine with Music Library, ML2, Net Radio and DVB-T Radio on the dev laptop. On the MVP it works fine with Music Library and ML2, but crashes the MVP when I run Net Radio or DVB-T Radio with this error
The failing line the last line in this
I'm having trouble figuring out what type of thing causes this error. I thought it might be something to do with one of the rendered layers, but I'm really just hoping that I've done something daft...
The last logging before the MVP restarts shows
Code:
2008-09-12 23:45:55.110 VERBOSE [7] Request completed. 2000 bytes sent
2008-09-12 23:45:55.142 ERROR [6] handleMVPConnection() exception: A generic error occurred in GDI+.
2008-09-12 23:45:55.142 VERBOSE [6] at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)
at System.Drawing.Image.Save(String filename, ImageFormat format)
at System.Drawing.Image.Save(String filename)
at PsycikProductions.MusicLibrary.MLPanel.ScreenSaver.GetRenderList() in C:\Documents and Settings\Alex\My Documents\Visual Studio 2005\Projects\MLPanel\ScreenSaver.cs:line 1683
at GBPVRX2.MenuTask.x9006c1ed9ccb79de.GetRenderList()
at GBPVRX2.MVP.x3ca133dee7547455.x19e39e0d5aeedfb8()
at GBPVRX2.MVP.x3ca133dee7547455.x3d75adb3418c5c9e()
2008-09-12 23:45:55.142 ERROR [6] handleMVPConnection() exception: A generic error occurred in GDI+.
2008-09-12 23:45:55.142 VERBOSE [6] at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)
at System.Drawing.Image.Save(String filename, ImageFormat format)
at System.Drawing.Image.Save(String filename)
at PsycikProductions.MusicLibrary.MLPanel.ScreenSaver.GetRenderList() in C:\Documents and Settings\Alex\My Documents\Visual Studio 2005\Projects\MLPanel\ScreenSaver.cs:line 1683
at GBPVRX2.MenuTask.x9006c1ed9ccb79de.GetRenderList()
at GBPVRX2.MVP.x3ca133dee7547455.x19e39e0d5aeedfb8()
at GBPVRX2.MVP.x3ca133dee7547455.x3d75adb3418c5c9e()
at GBPVRX2.MVP.x3ca133dee7547455.xd3faf5962405de4e()
Code:
[SIZE=2][COLOR=#008080][SIZE=2][COLOR=#008080]Bitmap[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] compositeRendering = [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#008080][SIZE=2][COLOR=#008080]Bitmap[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2](1280, 720);[/SIZE]
[SIZE=2][COLOR=#008080][SIZE=2][COLOR=#008080]Graphics[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] g = [/SIZE][SIZE=2][COLOR=#008080][SIZE=2][COLOR=#008080]Graphics[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].FromImage(compositeRendering);[/SIZE]
[SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]// draw each element from the render list to the appropriate place[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] (ACTLog) [/SIZE][SIZE=2][COLOR=#008080][SIZE=2][COLOR=#008080]PLogger[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].Info([/SIZE][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000]"ForEach starting: "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]);[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]foreach[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] ([/SIZE][SIZE=2][COLOR=#008080][SIZE=2][COLOR=#008080]GBPVRUiElement[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] uiElement [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]in[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] GRLitems)[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] x1 = ([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])((compositeRendering.Width / 100.0) * uiElement.oneOffRect.X);[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] y1 = ([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])((compositeRendering.Height / 100.0) * uiElement.oneOffRect.Y);[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] width = ([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])((compositeRendering.Width / 100.0) * uiElement.oneOffRect.Width);[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] height = ([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])((compositeRendering.Height / 100.0) * uiElement.oneOffRect.Height);[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] (ACTLog) [/SIZE][SIZE=2][COLOR=#008080][SIZE=2][COLOR=#008080]PLogger[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].Info([/SIZE][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000]"ForEach: "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + x1.ToString() + [/SIZE][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000]" "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + y1.ToString() + [/SIZE][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000]" "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] +[/SIZE]
[SIZE=2]width.ToString() + [/SIZE][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000]" "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + height.ToString() + [/SIZE][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000]" "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + uiElement.name );[/SIZE]
[SIZE=2]g.DrawImage(uiElement.image, [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#008080][SIZE=2][COLOR=#008080]Rectangle[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2](x1, y1, width, height));[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2]compositeRendering.Save(RecordingsDirectory + [/SIZE][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000]"\\MVP"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + clientIP + [/SIZE][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000]".jpg"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]);[/SIZE]
The last logging before the MVP restarts shows
Code:
13/09/2008 01:12:16 x9006c1ed9ccb79de GetRenderList INFO ForEach starting:
13/09/2008 01:12:16 x9006c1ed9ccb79de GetRenderList INFO ForEach: 0 0 1280 720 static (MLBackGround)
13/09/2008 01:12:16 x9006c1ed9ccb79de GetRenderList INFO ForEach: 332 151 832 388 static (Playing6)
13/09/2008 01:12:16 x9006c1ed9ccb79de GetRenderList INFO ForEach: 332 151 89 50 static (RecordingInProgress)