Click here to Skip to main content
15,892,005 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Florida Pin
OriginalGriff19-Feb-18 19:48
mveOriginalGriff19-Feb-18 19:48 
GeneralRe: Florida Pin
den2k8819-Feb-18 21:05
professionalden2k8819-Feb-18 21:05 
GeneralRe: Florida Pin
RickZeeland19-Feb-18 23:55
mveRickZeeland19-Feb-18 23:55 
GeneralRe: Florida Pin
den2k8820-Feb-18 0:03
professionalden2k8820-Feb-18 0:03 
PraiseRe: Florida Pin
RickZeeland20-Feb-18 0:27
mveRickZeeland20-Feb-18 0:27 
GeneralRe: Florida Pin
Daniel Pfeffer19-Feb-18 21:49
professionalDaniel Pfeffer19-Feb-18 21:49 
RantWho had *that* bright idea? Pin
Nagy Vilmos19-Feb-18 5:13
professionalNagy Vilmos19-Feb-18 5:13 
GeneralRe: Who had *that* bright idea? Pin
OriginalGriff19-Feb-18 5:19
mveOriginalGriff19-Feb-18 5:19 
If you mean in code, then yeah - in .NET at least that has been the case since V1.0: Image.FromFile Method (String) (System.Drawing)[^]
Quote:
The file remains locked until the Image is disposed.

Simplest solution:
C#
public static Image GetImage(string path)
   {
   using (Image im = Image.FromFile(path))
      {
      return new Bitmap(im);
      }
   }

Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!

GeneralRe: Who had *that* bright idea? Pin
Nagy Vilmos19-Feb-18 5:22
professionalNagy Vilmos19-Feb-18 5:22 
GeneralRe: Who had *that* bright idea? Pin
OriginalGriff19-Feb-18 5:29
mveOriginalGriff19-Feb-18 5:29 
GeneralRe: Who had *that* bright idea? Pin
Nagy Vilmos19-Feb-18 5:39
professionalNagy Vilmos19-Feb-18 5:39 
GeneralRe: Who had *that* bright idea? Pin
lopatir19-Feb-18 6:11
lopatir19-Feb-18 6:11 
GeneralRe: Who had *that* bright idea? Pin
OriginalGriff19-Feb-18 6:23
mveOriginalGriff19-Feb-18 6:23 
GeneralRe: Who had *that* bright idea? Pin
patbob19-Feb-18 5:47
patbob19-Feb-18 5:47 
GeneralRe: Who had *that* bright idea? Pin
Eddy Vluggen19-Feb-18 6:19
professionalEddy Vluggen19-Feb-18 6:19 
GeneralRe: Who had *that* bright idea? Pin
PIEBALDconsult19-Feb-18 6:09
mvePIEBALDconsult19-Feb-18 6:09 
GeneralRe: Who had *that* bright idea? Pin
Randor 19-Feb-18 6:53
professional Randor 19-Feb-18 6:53 
GeneralRe: Who had *that* bright idea? Pin
dandy7219-Feb-18 9:13
dandy7219-Feb-18 9:13 
GeneralRe: Who had *that* bright idea? Pin
Randor 19-Feb-18 9:34
professional Randor 19-Feb-18 9:34 
GeneralRe: Who had *that* bright idea? Pin
TheGreatAndPowerfulOz19-Feb-18 14:20
TheGreatAndPowerfulOz19-Feb-18 14:20 
GeneralRe: Who had *that* bright idea? Pin
patbob20-Feb-18 5:55
patbob20-Feb-18 5:55 
GeneralRe: Who had *that* bright idea? Pin
Eddy Vluggen19-Feb-18 6:23
professionalEddy Vluggen19-Feb-18 6:23 
GeneralRe: Who had *that* bright idea? Pin
Joe Woodbury19-Feb-18 8:23
professionalJoe Woodbury19-Feb-18 8:23 
GeneralRe: Who had *that* bright idea? Pin
Eddy Vluggen19-Feb-18 9:28
professionalEddy Vluggen19-Feb-18 9:28 
GeneralThought of the Day Pin
OriginalGriff19-Feb-18 4:58
mveOriginalGriff19-Feb-18 4:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.