NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 17 18 19 20 21 … 93 Next »
How to render a graphical volume display in nPVR

 
  • 0 Vote(s) - 0 Average
How to render a graphical volume display in nPVR
McBainUK
Offline

Posting Freak

Posts: 4,711
Threads: 429
Joined: Sep 2005
#1
2010-12-13, 01:56 PM
I'd like to show a progress bar type graphical display to show the current volume as part of my Volume OSD plugin.

I'd like to implement this in nPVR in an efficient and nice looking way. But, graphical stuff has never been my strong point so I'd like to open it up to the group Smile

Any help gratefully received.
Wiki profile
My Projects
Programs Plugin [SIZE=2](retired)
| Volume OSD Plugin (retired) | Documentation Wiki (retired)
[/SIZE]
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#2
2010-12-13, 02:11 PM
I'm at work and haven't got time to edit this, but here's the code I use in the System plugin for drawing, which includes progress bars with gradient paints (cFreeL, cFreeR, etc are Color objects):

Code:
// Return an image for a given drive (name).
public Image GetImage(Hashtable parameters, string name, int width, int height)
{
    // If the request is for "@drvIcon", just return the stored bitmap
    if (images[name] != null)
        return (Image) images[name];

    // If the request is for "@drvRatio, then we need to draw the chart
    if (ratios[name] != null)
    {
        float percent = (float)ratios[name];

        Brush bg = new LinearGradientBrush(new Rectangle(0, 0, width+width/3, height), cFreeL, cFreeR, 45, false);
        Brush fg = new LinearGradientBrush(new Rectangle(0, 0, width+width/3, height), cUsedL, cUsedR, 45, false);                

        Bitmap bitmap = new Bitmap(width, height);
        Graphics g = Graphics.FromImage(bitmap);

        g.FillRectangle(bg, 0, 0, width - 1, height - 1);
        g.FillRectangle(fg, 0, 0, (percent) * (width - 1), height - 1);
        g.DrawRectangle(new Pen(cOutline, 5), 0, 0, width - 1, height - 1);
        g.Dispose();

        return bitmap;
    }

    return null;
}
McBainUK
Offline

Posting Freak

Posts: 4,711
Threads: 429
Joined: Sep 2005
#3
2010-12-13, 02:20 PM
That looks like a very good start. Thanks.

Out of interest what is 'TimeSharer' referring to in your sig, a holiday apartment search plugin? Smile
Wiki profile
My Projects
Programs Plugin [SIZE=2](retired)
| Volume OSD Plugin (retired) | Documentation Wiki (retired)
[/SIZE]
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#4
2010-12-13, 03:25 PM
McBainUK Wrote:Out of interest what is 'TimeSharer' referring to in your sig, a holiday apartment search plugin? Smile

Heh. It was my solution to this problem (http://forums.nextpvr.com/showthread.php...g-channels), but I still can't decide whether to make it public or not.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Way to tell programmatically if channel load in from NPVR has finished... gdogg371 3 2,352 2021-03-11, 03:59 PM
Last Post: mvallevand
  Plugins and NPVR. Where do we start? sub 80 68,384 2020-11-26, 10:02 PM
Last Post: mandai
  Test/Development environment for npvr.db3 scJohn 10 4,267 2020-09-04, 09:14 PM
Last Post: scJohn
  How to extract M3U8 and get matching XMLTV guide data from NPVR almightyj 0 3,405 2018-10-23, 07:24 AM
Last Post: almightyj
  ios app to control npvr ui idea jnbooker15 4 3,574 2015-09-21, 10:19 PM
Last Post: sub
  ios app to control npvr ui idea jnbooker15 0 2,458 2015-09-21, 06:39 PM
Last Post: jnbooker15
  Couple of questions about hacking npvr.db3 drmargarit 6 4,235 2014-09-08, 02:22 AM
Last Post: sub
  high res (256x256+) npvr icon? reven 15 5,805 2013-09-01, 05:13 AM
Last Post: psycik
  trying to fake npvr database for unit tests reven 3 2,248 2013-05-20, 08:53 AM
Last Post: reven
  Multiple genres in npvr.db3 bgowland 5 2,825 2013-04-16, 09:53 PM
Last Post: ACTCMS

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

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

Linear Mode
Threaded Mode