NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Wishlist v
« Previous 1 … 121 122 123 124 125 … 193 Next »
Unlock task image files

 
  • 0 Vote(s) - 0 Average
Unlock task image files
Old Dog
Offline

Posting Freak

Posts: 1,083
Threads: 99
Joined: Jul 2005
#1
2006-02-12, 06:38 PM
Hi sub,

I was updating Appearance Manager to allow selection of task images when I discovered that GBPVR.exe has blocked access to the task image files.

Can these files be unblocked?

Regards,
David
Learning new tricks!
Visit Plain Jane's Collection
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,627
Threads: 767
Joined: Nov 2003
#2
2006-02-12, 06:46 PM
Most people load images using the Image.FromFile() .net API which locks the files. It would have to be changed by every developer in every plugin.
Old Dog
Offline

Posting Freak

Posts: 1,083
Threads: 99
Joined: Jul 2005
#3
2006-02-12, 06:56 PM
Okay. I personally don't see this as a high priority feature (I've been putting it off).

Thanks,
David
Learning new tricks!
Visit Plain Jane's Collection
gruskada
Offline

Member

Posts: 121
Threads: 20
Joined: Dec 2005
#4
2006-02-16, 04:04 PM
sub Wrote:Most people load images using the Image.FromFile() .net API which locks the files. It would have to be changed by every developer in every plugin.

Is there a better way to do it?

gruskada
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,627
Threads: 767
Joined: Nov 2003
#5
2006-02-16, 04:49 PM
In most cases locking the file it fine, so it may not be "better", but you can do the following to load an image without locking it:

Code:
FileStream fs;                        
fs = new FileStream(filename, FileMode.Open, FileAccess.Read);
Image tempImage = System.Drawing.Image.FromStream(fs);
fs.Close();
reven
Offline

Posting Freak

Posts: 5,782
Threads: 396
Joined: Sep 2004
#6
2006-02-16, 06:41 PM
wouldnt this be a little bit better
Code:
Image img = null;
using(FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read)){
      img = System.Drawing.Image.FromStream(fs);
}
i read somewhere that you should use "using" whenever you can, .net will handle all the clean up better. or so i read, somewhere.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,627
Threads: 767
Joined: Nov 2003
#7
2006-02-16, 06:46 PM
Each to their own. There is nothing wrong with the code I wrote above. I'm from the world of C++, so I write code that looks very C++'esq.
gruskada
Offline

Member

Posts: 121
Threads: 20
Joined: Dec 2005
#8
2006-02-16, 07:39 PM
reven Wrote:wouldnt this be a little bit better
Code:
Image img = null;
using(FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read)){
      img = System.Drawing.Image.FromStream(fs);
}
i read somewhere that you should use "using" whenever you can, .net will handle all the clean up better. or so i read, somewhere.

I think the only real difference is that you don't need to explicitly call close() with using (which people may forget to do otherwise), but I could be wrong.

gruskada
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  RFC DVB tuning files mvallevand 0 506 2024-03-04, 01:22 PM
Last Post: mvallevand
  Thumbnail support for .wtv and .avi files in version 5 Jimixter 2 1,884 2019-12-18, 04:29 PM
Last Post: sub
  Watched Indicator for Multiple Video Files with the Same File Name cweseloh 1 1,759 2018-06-26, 05:02 PM
Last Post: sub
  Make the "Zip my log files" text larger HarryH3 1 1,425 2017-11-26, 08:04 AM
Last Post: sub
  converting .ts files ldenorio 8 4,554 2017-07-02, 09:55 AM
Last Post: puck64
  video_ts files and metadata jam_zhou 8 4,655 2014-06-04, 12:05 AM
Last Post: mvallevand
  Power savings : .bat files needed to switch on/off setupbox_HDPVR_etc Abbadon 2 2,548 2013-11-11, 03:33 AM
Last Post: pBS
  Deleteing folders with NFO files mvallevand 8 4,111 2012-12-22, 08:28 PM
Last Post: mvallevand
  delete ".incommercial" files generated by comskip reven 2 1,985 2012-10-18, 04:26 PM
Last Post: pBS
  Separate log files for each NMT ElihuRozen 0 1,141 2012-05-30, 03:05 PM
Last Post: ElihuRozen

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

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

Linear Mode
Threaded Mode