Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Small tip on using images
Message
De
11/04/2016 02:26:25
 
 
À
10/04/2016 16:51:46
Information générale
Forum:
ASP.NET
Catégorie:
Photos et traitement d'images
Versions des environnements
Environment:
VB 9.0
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01634620
Message ID:
01634634
Vues:
41
>>Better to use 'Using ..... End Using' - that way Dispose() will be called even if an exception is thrown inside the block :
>>https://msdn.microsoft.com/en-us/library/htd05whh(v=vs.120).aspx
>
>That applies in certain situations. In this case, oImage has a reference from another method. So, I cannot broadcast a Using syntax across methods.

Can''t see what you mean. In the code listed both disposables are instantiated in the method:
Dim loGraphics As System.Drawing.Graphics = Nothing
Dim loImage As System.Drawing.Bitmap = Nothing
>But, inside a method, yes, I have it at several locations and it works great.
>
>Thanks
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform