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

Re: Speed issue loading image by kimiraikkonen

kimiraikkonen
Thu May 08 11:15:26 CDT 2008

On May 8, 7:08=A0pm, "John" <i...@nospam.infovis.co.uk> wrote:
> Hi
>
> I am using below statement to load an image;
>
> Me.MyPictureBox.Image =3D Image.FromFile(CStr(Me.txtMyPhotoPath.Value))
>
> Problem is it is taking too long and slowing the app down. Is there anothe=
r
> 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 =3D "c:\image\image.JPG" ' Enter yours

thanks,

Onur

Re: Speed issue loading image by Cor

Cor
Thu May 08 11:20:30 CDT 2008

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" <info@nospam.infovis.co.uk> schreef in bericht
news:%23OhLMXSsIHA.5724@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
>


Re: Speed issue loading image by John

John
Thu May 08 11:44:35 CDT 2008

Is Me.txtMyPhotoPath.Value.ToString better? The field is an Infragistics
UltraText field bound to a table.

Regards

"Cor Ligthert[MVP]" <notmyfirstname@planet.nl> wrote in message
news:441660BB-9C7A-425B-B532-3688E00BE5A3@microsoft.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" <info@nospam.infovis.co.uk> schreef in bericht
> news:%23OhLMXSsIHA.5724@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
>>
>



Re: Speed issue loading image by Cor

Cor
Fri May 09 02:50:41 CDT 2008

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" <info@nospam.infovis.co.uk> schreef in bericht
news:ORa4KrSsIHA.484@TK2MSFTNGP04.phx.gbl...
> Is Me.txtMyPhotoPath.Value.ToString better? The field is an Infragistics
> UltraText field bound to a table.
>
> Regards
>
> "Cor Ligthert[MVP]" <notmyfirstname@planet.nl> wrote in message
> news:441660BB-9C7A-425B-B532-3688E00BE5A3@microsoft.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" <info@nospam.infovis.co.uk> schreef in bericht
>> news:%23OhLMXSsIHA.5724@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
>>>
>>
>
>