Page 1 of 1

[visual basic] Lolwut?

Posted: Thu 30 Aug, 2007 4:09 pm
by driesguldolf
I was experimenting a bit and then this happend:
Image
And I was like "lolwut?"

So how is this possible? (I'm not an expert in visualbasic, learning C++ now)

Posted: Thu 30 Aug, 2007 4:45 pm
by benryves
Quite simply; the ImageFormat class has static properties that return new instances of the class set to a particular ImageFormat type.

If you have an instance of ImageFormat, you can then (via Visual Studio's debugger) access the ImageFormat's static members to retrieve another instance of the ImageFormat, then use that new instance to retrieve another one, and so on and so forth...

Edit: C#'s debugger makes it more obvious that you're accessing static members - screenshot.

Posted: Thu 30 Aug, 2007 5:08 pm
by driesguldolf
Ah ok, thanks for the info!
(I knew it was somewhere very normal)