NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 42 43 44 45 46 … 93 Next »
How to draw a string in PVRX2?

 
  • 0 Vote(s) - 0 Average
How to draw a string in PVRX2?
alibert
Offline

Posting Freak

Posts: 974
Threads: 83
Joined: Apr 2005
#1
2007-07-19, 10:21 AM
Hi,

I'm just trying to get my tv listings plugin ported to v1.0, but now it seems that I'm stuck at getting the programme titles drawn into the grid. What should be the preferred way to draw strings without having a composite image defined explicitly in the skin.xml file?

Thanks,
-alibert
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,717
Threads: 767
Joined: Nov 2003
#2
2007-07-19, 04:50 PM
In the default TV Guide, I have create a GBPVRUiImage object that represents the tv listing grid, then I just use GDI+ calls to draw listing out lines and text etc onto it's 'image'. This object is added to the list during the GetRenderList() call. You can still use the skinhelper2.getNamedFont() call to dynamically scaled fonts for drawing into the grid.
psycik
Offline

Posting Freak

Posts: 5,210
Threads: 424
Joined: Sep 2005
#3
2007-07-19, 08:09 PM
Ahh good, was meaning to ask this...
ta
herrmannj
Offline

Member

Posts: 150
Threads: 22
Joined: May 2005
#4
2007-07-19, 09:04 PM
sorry asking, did you mean GBPVRUiImage or GBPVRUiElement.image.
If the second - how do you use the gdi+ methods on the *.image ?

btw
I found that if I call skinHelper2.getNamedImage(view.image, "Element", args) several time to reflect dynamic updates in args, the view.mage will not be replaced, instead the existing image will be mixed with the new one. So I do it:
view.image = new Bitmap(view.image.Width, view.image.Height, view.image.PixelFormat);
skinHelper2.getNamedImage(view.image, "Element", args);
view.forceRefresh = true; (this copy image to texture)?

Is there a better way ?

Joerg
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,717
Threads: 767
Joined: Nov 2003
#5
2007-07-19, 09:09 PM
herrmannj Wrote:sorry asking, did you mean GBPVRUiImage or GBPVRUiElement.image.
Sorry, yes I did mean GBPVRUiElement.

Quote:If the second - how do you use the gdi+ methods on the *.image ?
Just the same as you'd normally operator on an image:

Graphics g = Graphics.FromImage(uiElement.image);
g.Clear(Color.Red);
g.DrawText(....) etc

Quote:I found that if I call skinHelper2.getNamedImage(view.image, "Element", args) several time to reflect dynamic updates in args, the view.mage will not be replaced, instead the existing image will be mixed with the new one. So I do it:
view.image = new Bitmap(view.image.Width, view.image.Height, view.image.PixelFormat);
skinHelper2.getNamedImage(view.image, "Element", args);
view.forceRefresh = true; (this copy image to texture)?
Just do a Graphics.FromImage(view.image).Clear(Color.Transparent);

I'll add an addition getNamedImage() override that lets you request the image is cleared before getNamedImage does its thing.
alibert
Offline

Posting Freak

Posts: 974
Threads: 83
Joined: Apr 2005
#6
2007-07-20, 05:04 AM
Hi and thanks,

I already tried something similar, but with each single visible programme instead of creating a bitmap for the whole guide - and this took some time...

One more question: Which size should one use to create the bitmap? I saw that there is something like getcurrentresolution(), but this wouldn't always reflect the current size of the gbpvr window?
And is there a new call of getrenderlist() each time the size of the gbpvr window changes?

-alibert
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,717
Threads: 767
Joined: Nov 2003
#7
2007-07-20, 05:11 AM
The internal rendering is always done at the resolution of the monitor its created on. When you skrink it to a smaller window, then direct3d is just resizing the textures as appropriate. (this why text looks perfect at fullscreen, and less than perfect in a smaller window)

Quote:I already tried something similar, but with each single visible programme instead of creating a bitmap for the whole guide - and this took some time...
I wouldnt recommend going that way. It'd be much more straight forward to have one image holding the listing grid like I've done.
alibert
Offline

Posting Freak

Posts: 974
Threads: 83
Joined: Apr 2005
#8
2007-07-21, 11:34 AM
Hi,

I think I got it now using one bitmap object per channel row. I was a bit unfamiliar with the relative sizes and when to use the absolute ones.

One more question: Which "TextRenderingHint" should be chosen for the graphics object?

-alibert
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,717
Threads: 767
Joined: Nov 2003
#9
2007-07-21, 04:41 PM
I'm using AntiAliasGridFit.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Is the input file for pvrx2.exe -import unique to NextPVR? spinnaker 1 1,781 2013-10-08, 02:25 AM
Last Post: sub
  draw image border herrmannj 8 2,636 2010-01-13, 09:46 PM
Last Post: herrmannj
  pvrx2 / plugin assembly resolution bgowland 6 2,362 2009-02-05, 11:14 PM
Last Post: bgowland
  Displaying web pages in pvrx2 psycik 4 2,044 2009-01-23, 07:59 PM
Last Post: psycik
  Opening an external program from PVRX2 mkenyon2 1 1,312 2009-01-06, 10:05 PM
Last Post: pastro
  Tunging string question. whurlston 3 1,832 2009-01-02, 04:51 PM
Last Post: whurlston
  Aspect ratio for PVRX2 application Hairy 3 1,887 2008-11-09, 04:52 PM
Last Post: Hairy
  KeyMappings - PVRX2 - BaseButtonUIList psycik 1 1,280 2007-12-16, 04:06 PM
Last Post: sub
  Threads in Plugins won't terminate when PVRX2/GBPVR exits ralphy 6 2,263 2007-09-28, 12:39 PM
Last Post: sub
  PVRX2 Plugin in Config all psycik 7 2,410 2007-08-18, 03:29 AM
Last Post: sub

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

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

Linear Mode
Threaded Mode