Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Small tip on using images
Message
From
11/04/2016 02:26:25
 
 
To
10/04/2016 16:51:46
General information
Forum:
ASP.NET
Category:
Pictures and Image processing
Environment versions
Environment:
VB 9.0
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01634620
Message ID:
01634634
Views:
42
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform