473,498 Members | 1,633 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Speed issue loading image

Hi

I am using below statement to load an image;

Me.MyPictureBox.Image = Image.FromFile(CStr(Me.txtMyPhotoPath.Value))

Problem is it is taking too long and slowing the app down. Is there another
faster way to achieve this? or to degrade the quality of image on the fly to
have to load smaller version of image for example?

Thanks

Regards
Jun 27 '08 #1
4 753
On May 8, 7:08*pm, "John" <i...@nospam.infovis.co.ukwrote:
Hi

I am using below statement to load an image;

Me.MyPictureBox.Image = Image.FromFile(CStr(Me.txtMyPhotoPath.Value))

Problem is it is taking too long and slowing the app down. Is there another
faster way to achieve this? or to degrade the quality of image on the fly to
have to load smaller version of image for example?

Thanks

Regards
Would you try:

MyPictureBox.ImageLocation = "c:\image\image.JPG" ' Enter yours

thanks,

Onur
Jun 27 '08 #2
John,

It should go as slow as every other tool that reads an image.

But why is that CStr(Me.txtMyPhotoPath.Value)), do you have more of this
kind of senseless code in your class?
It smells if you have used only objects and is all the time boxing and
unboxing.

Cor

"John" <in**@nospam.infovis.co.ukschreef in bericht
news:%2****************@TK2MSFTNGP06.phx.gbl...
Hi

I am using below statement to load an image;

Me.MyPictureBox.Image = Image.FromFile(CStr(Me.txtMyPhotoPath.Value))

Problem is it is taking too long and slowing the app down. Is there
another faster way to achieve this? or to degrade the quality of image on
the fly to have to load smaller version of image for example?

Thanks

Regards
Jun 27 '08 #3
Is Me.txtMyPhotoPath.Value.ToString better? The field is an Infragistics
UltraText field bound to a table.

Regards

"Cor Ligthert[MVP]" <no************@planet.nlwrote in message
news:44**********************************@microsof t.com...
John,

It should go as slow as every other tool that reads an image.

But why is that CStr(Me.txtMyPhotoPath.Value)), do you have more of this
kind of senseless code in your class?
It smells if you have used only objects and is all the time boxing and
unboxing.

Cor

"John" <in**@nospam.infovis.co.ukschreef in bericht
news:%2****************@TK2MSFTNGP06.phx.gbl...
>Hi

I am using below statement to load an image;

Me.MyPictureBox.Image = Image.FromFile(CStr(Me.txtMyPhotoPath.Value))

Problem is it is taking too long and slowing the app down. Is there
another faster way to achieve this? or to degrade the quality of image on
the fly to have to load smaller version of image for example?

Thanks

Regards

Jun 27 '08 #4
John,

Normally that path is given at a string, so what type is that value.

The ToString can never be needed here (or it should be an object) as a path
contains forever (special) characters.

If it is an object the ToString acts in my idea the same as CStr while the
latter makes it only less understandable)

Cor

"John" <in**@nospam.infovis.co.ukschreef in bericht
news:OR*************@TK2MSFTNGP04.phx.gbl...
Is Me.txtMyPhotoPath.Value.ToString better? The field is an Infragistics
UltraText field bound to a table.

Regards

"Cor Ligthert[MVP]" <no************@planet.nlwrote in message
news:44**********************************@microsof t.com...
>John,

It should go as slow as every other tool that reads an image.

But why is that CStr(Me.txtMyPhotoPath.Value)), do you have more of this
kind of senseless code in your class?
It smells if you have used only objects and is all the time boxing and
unboxing.

Cor

"John" <in**@nospam.infovis.co.ukschreef in bericht
news:%2****************@TK2MSFTNGP06.phx.gbl...
>>Hi

I am using below statement to load an image;

Me.MyPictureBox.Image = Image.FromFile(CStr(Me.txtMyPhotoPath.Value))

Problem is it is taking too long and slowing the app down. Is there
another faster way to achieve this? or to degrade the quality of image
on the fly to have to load smaller version of image for example?

Thanks

Regards

Jun 27 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
7411
by: Jordanakins | last post by:
Usenet, I am currently working on my website and am needing to detect the connection speed of the client. I would like to do this in PHP and not use any other languages. This makes it a bit more...
1
1341
by: Vitamin | last post by:
if a page always have some picture that totally have near 250k does this a main point of affect the loading speed?
60
10076
by: Neil | last post by:
I have a situation with an ODBC linked view in an Access 2000 MDB with a SQL 7 back end. The view is scrolling very slowly. However, if I open the view in an ADP file, it scrolls quickly. I...
5
5761
by: Sharon | last post by:
I’m writing a Windows application. In the form I have a Panel and inside the panel I have a PictureBox control. I’m loading the PictureBox control with BMP image that has the following...
17
2494
by: sloank | last post by:
anyone know how to set up a 'speed bump'. once someone clicks on an external link on my website, I want a page to come up that says you are leaving my site, with an OK button. once the OK button...
8
3011
by: Alexander Fischer | last post by:
Hello, I am writing a gallery script and use imagecreatefromjpeg and fpassthru to output images without any change to them (i.e., no thumbnail creation etc. - just deliver the image via the php...
2
2725
by: jphelan | last post by:
Ever since I successfully applied some techniques for increasing the speed of my 17 meg. Application; it has only made me hunger for more. First, let me list what I have done so far: 1. Split...
5
1412
by: =?Utf-8?B?U3RlZmFuIEJhcmxvdw==?= | last post by:
I am experiencing a lot of speed issues on initial app loads where we are referencing 3rd party 1.1 assemblies from 2.0 code. Those 1.1 assemblies reference things like System.Windows.Forms...
7
2063
by: Peted | last post by:
Hi, im hoping someone cane provide or point to a definitive accurate explantion of dotnet compilation when run and the best way to optimise peformace when dotnet code is run first time and...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7004
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7167
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7208
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7379
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5464
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4915
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
292
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.