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
>>>
>>
>
>