NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 29 30 31 32 33 … 93 Next »
Creating a jpg from GetRenderList

 
  • 0 Vote(s) - 0 Average
Creating a jpg from GetRenderList
ACTCMS
Offline

Posting Freak

UK
Posts: 2,730
Threads: 101
Joined: Jun 2007
#1
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

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()
The failing line the last line in this
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]
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:
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)
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,945
Threads: 770
Joined: Nov 2003
#2
2008-09-13, 01:14 AM
I cant see an obvious cause, but I'd temporarily change it to saving a .bmp to see if it makes any difference. I've seen something like this before, and for whatever saving a .bmp worked.
ACTCMS
Offline

Posting Freak

UK
Posts: 2,730
Threads: 101
Joined: Jun 2007
#3
2008-09-13, 02:15 AM
Thanks - nice call - it works fine with a .bmp. I also tried it with a .png and it seems to go a bit further before it crashes - I logged this just before the .png version crashed
Code:
13/09/2008 02:48:17 x9006c1ed9ccb79de GetRenderList INFO ForEach starting:

[align=left]13/09/2008 02:48:17 x9006c1ed9ccb79de GetRenderList INFO ForEach: 0 0 1280 720 static (MLBackGround) [/align]

[align=left]13/09/2008 02:48:17 x9006c1ed9ccb79de GetRenderList INFO ForEach: 524 309 960 496 static (Playing8) [/align]
x1 + width and y1 + height both cause part of the image to render outside of the dimensions of the image. The occasional incorrect placement is something I'm aware of, but I haven't got round to fixing it yet. Could it be that .jpg is zero-tolerance, .png tries to be a bit more understanding and .bmp doesn't care? I'll fix the placement problem and see if that helps (Jaggy will be pleased)
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,945
Threads: 770
Joined: Nov 2003
#4
2008-09-13, 02:21 AM
I'm not really sure.
ACTCMS
Offline

Posting Freak

UK
Posts: 2,730
Threads: 101
Joined: Jun 2007
#5
2008-09-13, 02:31 AM
sub Wrote:I'm not really sure.
Neither am I, but I've now got a direction to go in - thanks
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 53,443
Threads: 963
Joined: May 2006
#6
2008-09-13, 03:10 AM
If this is too difficult I now can create a png from the raw information that GBPVR sends. It is much slower but it might be an option.

Martin
ACTCMS
Offline

Posting Freak

UK
Posts: 2,730
Threads: 101
Joined: Jun 2007
#7
2008-09-13, 03:39 AM
mvallevand Wrote:If this is too difficult I now can create a png from the raw information that GBPVR sends. It is much slower but it might be an option.

Martin
I suspect that I've got a fairly simple problem with my rendering, but this would be a good fallback if I can't fix it.

However, if your solution is quick enough to be acceptable to most users, then it would surely be the way to go, since it would work for other plugins too.

Alex
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 53,443
Threads: 963
Joined: May 2006
#8
2008-09-13, 06:03 AM
I thought I'd give you a peek at where reading from MLPanel's png is at now

http://www.youtube.com/watch?v=_hK-eB0uOlE

I'm still not sure if I will release this.

Martin
ACTCMS
Offline

Posting Freak

UK
Posts: 2,730
Threads: 101
Joined: Jun 2007
#9
2008-09-14, 01:21 AM
ACTCMS Wrote:Neither am I, but I've now got a direction to go in - thanks
If music is playing, MLP looks for and displays any jpg, gif or png files in the MP3's containing folder, which is the recordings dir when Net Radio or DVB-T Radio are playing - I'm saving the images in the recordings dir, so I was trying to display files I could have been in the process of creating - or vice-versa - anyway, it's some sort of conflict.

Thanks for the pointer...
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Best approach to creating recurring recordings from c# drmargarit 0 2,759 2015-09-27, 01:32 AM
Last Post: drmargarit
  GetRenderList() always called with "block-extras..." element in renderlist alibert 1 1,790 2012-06-18, 10:24 AM
Last Post: sub
  Creating a Windows service McBainUK 8 3,840 2011-03-30, 03:29 AM
Last Post: mvallevand
  GetRenderList() herrmannj 5 2,596 2008-10-14, 08:05 PM
Last Post: herrmannj
  Retrieving Images from GetRenderList psycik 11 4,247 2008-08-10, 08:33 PM
Last Post: mvallevand
  needsRendering() and GetRenderList() JavaWiz 3 2,086 2008-05-22, 03:25 AM
Last Post: sub
  Creating a Video Popup Plug-in Jeff 4 2,518 2006-08-25, 07:22 AM
Last Post: elite
  Question about creating selection lists... spyork 3 1,941 2006-01-21, 09:32 PM
Last Post: McBainUK
  creating a trigger in access .mdb databases? reven 7 5,929 2005-10-07, 04:23 AM
Last Post: reven
  Started creating a Comskip tuning manual erik 3 2,765 2005-10-05, 07:39 PM
Last Post: erik

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode