home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Loading pictures in MP alot faster
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="ingig" data-source="post: 75388" data-attributes="member: 24608"><p>I just downloaded the MP source code and just looking around in it. Hopefully create a plugin sometime soon. </p><p></p><p>I noticed one thing in the source code about how you load the images.</p><p></p><p>This is usually done this way in MP</p><p>[code]</p><p>using (Image img = Image.FromFile(fileName))</p><p>{</p><p> //do stuff</p><p>}</p><p>[/code]</p><p></p><p>What is a great way to load images, maybe 100 times faster, is this way</p><p></p><p>[code]</p><p>using (FileStream fs = new FileStream(fullName, FileMode.Open, FileAccess.Read))</p><p>{</p><p> using (Image g = Image.FromStream(fs, true, false))</p><p> {</p><p> //do stuff</p><p> }</p><p>}</p><p>[/code]</p><p></p><p>The reason this is alot faster is that Image.FromFile(fileName) does some type of check on the image. </p><p></p><p>You can read more about it on this blog <a href="http://blogs.msdn.com/omars/archive/2004/03/29/100941.aspx" target="_blank">http://blogs.msdn.com/omars/archive/2004/03/29/100941.aspx</a></p></blockquote><p></p>
[QUOTE="ingig, post: 75388, member: 24608"] I just downloaded the MP source code and just looking around in it. Hopefully create a plugin sometime soon. I noticed one thing in the source code about how you load the images. This is usually done this way in MP [code] using (Image img = Image.FromFile(fileName)) { //do stuff } [/code] What is a great way to load images, maybe 100 times faster, is this way [code] using (FileStream fs = new FileStream(fullName, FileMode.Open, FileAccess.Read)) { using (Image g = Image.FromStream(fs, true, false)) { //do stuff } } [/code] The reason this is alot faster is that Image.FromFile(fileName) does some type of check on the image. You can read more about it on this blog [url]http://blogs.msdn.com/omars/archive/2004/03/29/100941.aspx[/url] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Loading pictures in MP alot faster
Contact us
RSS
Top
Bottom