By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,289 Members | 1,337 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,289 IT Pros & Developers. It's quick & easy.

A question about finding class methods in the Help

P: n/a
usually I'd do: Drawing.Image.FromFile(

I noticed I once did without thinking: Drawing.Bitmap.FromFile(

I assumed this worked because Bitmap inherits from Image, but for fun I
thought I'd check the Doc and see what it says for Bitmap.FromFile. I
expected it to say "(inherited from Image)". But I could find no reference
to Bitmap.FromFile anywhere in the help.

There were times when I looked for something and couldn't find it so I'm now
wondering if I'm expecting something that is not there.

Is the help for Bitmap.FromFile someplace in the Docs and I'm missing it?

If I want the complete help on a class do I need to manually examine all the
classes it inherits from?

Thanks
Jan 24 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
**Developer**,
Bitmap.FromFile is not in the help per se, as Bitmap itself does not
directly have a FromFile method, as you point out its inherited from Image.
If Bitmap had Shadowed or Overrode FromFile, then help would have listed it.

What I normally do is look at the "Bitmap Members" page:

http://msdn.microsoft.com/library/de...mbersTopic.asp

It lists all the members of Bitmap, including inherited members. I would see
that Bitmap FromFile is inherited, clicking the link would take me to where
its inherited from...

A lot of times I use the Object Browser to look for classes I may need, once
I find it in Object Browser I then refer to help to get more specifics...

--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
" **Developer**" <RE*************@a-znet.com> wrote in message
news:uy*************@TK2MSFTNGP15.phx.gbl...
| usually I'd do: Drawing.Image.FromFile(
|
| I noticed I once did without thinking: Drawing.Bitmap.FromFile(
|
| I assumed this worked because Bitmap inherits from Image, but for fun I
| thought I'd check the Doc and see what it says for Bitmap.FromFile. I
| expected it to say "(inherited from Image)". But I could find no reference
| to Bitmap.FromFile anywhere in the help.
|
| There were times when I looked for something and couldn't find it so I'm
now
| wondering if I'm expecting something that is not there.
|
| Is the help for Bitmap.FromFile someplace in the Docs and I'm missing it?
|
| If I want the complete help on a class do I need to manually examine all
the
| classes it inherits from?
|
|
|
| Thanks
|
|
Jan 24 '06 #2

P: n/a

"Jay B. Harlow [MVP - Outlook]" <Ja************@tsbradley.net> wrote in
message news:ON**************@TK2MSFTNGP15.phx.gbl...
**Developer**,
Bitmap.FromFile is not in the help per se, as Bitmap itself does not
directly have a FromFile method, as you point out its inherited from
Image.
If Bitmap had Shadowed or Overrode FromFile, then help would have listed
it.
Are you saying that if it is inherited but not Shadowed nor Overrode it
would not appear in the help that shows the Bitmap methods?

What I normally do is look at the "Bitmap Members" page:

http://msdn.microsoft.com/library/de...mbersTopic.asp

It lists all the members of Bitmap,
I understood the above to mean it would not show unless it had Shadowed nor
Overrode - if so it would not show here

including inherited members. I would see that Bitmap FromFile is inherited, clicking the link would take me to
where
its inherited from...
But when I look at the site or my equivalent Help I don't see FromFile. You
do?

Thanks

A lot of times I use the Object Browser to look for classes I may need,
once
I find it in Object Browser I then refer to help to get more specifics...

--
Hope this helps
Jay [MVP - Outlook]
.NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
" **Developer**" <RE*************@a-znet.com> wrote in message
news:uy*************@TK2MSFTNGP15.phx.gbl...
| usually I'd do: Drawing.Image.FromFile(
|
| I noticed I once did without thinking: Drawing.Bitmap.FromFile(
|
| I assumed this worked because Bitmap inherits from Image, but for fun I
| thought I'd check the Doc and see what it says for Bitmap.FromFile. I
| expected it to say "(inherited from Image)". But I could find no
reference
| to Bitmap.FromFile anywhere in the help.
|
| There were times when I looked for something and couldn't find it so I'm
now
| wondering if I'm expecting something that is not there.
|
| Is the help for Bitmap.FromFile someplace in the Docs and I'm missing
it?
|
| If I want the complete help on a class do I need to manually examine all
the
| classes it inherits from?
|
|
|
| Thanks
|
|

Jan 24 '06 #3

P: n/a
" **Developer**" <RE*************@a-znet.com> schrieb:
usually I'd do: Drawing.Image.FromFile(

I noticed I once did without thinking: Drawing.Bitmap.FromFile(

I assumed this worked because Bitmap inherits from Image, but for fun I
thought I'd check the Doc and see what it says for Bitmap.FromFile. I
expected it to say "(inherited from Image)". But I could find no reference
to Bitmap.FromFile anywhere in the help.


In addition to the other replies: Note that 'Image.FromFile' is a shared
method and thus cannot be overridden in a class derived from 'Image'. I
strongly recommend to use 'Image.FromFile' instead of 'Bitmap.FromFile' as
the latter will make the user think that the method's formal return type is
'Bitmap', but instead it's still 'Image' and a cast is necessary when the
resulting reference should be assigned to a variable of type 'Bitmap'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jan 24 '06 #4

P: n/a
| Are you saying that if it is inherited but not Shadowed nor Overrode it
| would not appear in the help that shows the Bitmap methods?
I'm saying if its inherited, it will not show in the Index or Table of
Contents unless its Shadowed or Overrode.

Whether its Shadowed or Overrode or not, it will always show on the Bitmap
members page itself.

| But when I look at the site or my equivalent Help I don't see FromFile.
You
| do?
DOH! Bitmap members won't show it, as its shared! The above is for
instance members.

Although VB allows you to call shared members of base clases, only the base
class has the Shared member. VB quietly changes Bitmap.FromFile to
Image.FromFile in the IL.
--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
" **Developer**" <RE*************@a-znet.com> wrote in message
news:uE**************@TK2MSFTNGP15.phx.gbl...
|
| "Jay B. Harlow [MVP - Outlook]" <Ja************@tsbradley.net> wrote in
| message news:ON**************@TK2MSFTNGP15.phx.gbl...
| > **Developer**,
| > Bitmap.FromFile is not in the help per se, as Bitmap itself does not
| > directly have a FromFile method, as you point out its inherited from
| > Image.
| > If Bitmap had Shadowed or Overrode FromFile, then help would have listed
| > it.
|
| Are you saying that if it is inherited but not Shadowed nor Overrode it
| would not appear in the help that shows the Bitmap methods?
|
| >
| > What I normally do is look at the "Bitmap Members" page:
| >
| >
http://msdn.microsoft.com/library/de...mbersTopic.asp
| >
| > It lists all the members of Bitmap,
|
| I understood the above to mean it would not show unless it had Shadowed
nor
| Overrode - if so it would not show here
|
| including inherited members. I would see
| > that Bitmap FromFile is inherited, clicking the link would take me to
| > where
| > its inherited from...
|
| But when I look at the site or my equivalent Help I don't see FromFile.
You
| do?
|
| Thanks
|
| >
| > A lot of times I use the Object Browser to look for classes I may need,
| > once
| > I find it in Object Browser I then refer to help to get more
specifics...
| >
| > --
| > Hope this helps
| > Jay [MVP - Outlook]
| > .NET Application Architect, Enthusiast, & Evangelist
| > T.S. Bradley - http://www.tsbradley.net
| >
| >
| > " **Developer**" <RE*************@a-znet.com> wrote in message
| > news:uy*************@TK2MSFTNGP15.phx.gbl...
| > | usually I'd do: Drawing.Image.FromFile(
| > |
| > | I noticed I once did without thinking: Drawing.Bitmap.FromFile(
| > |
| > | I assumed this worked because Bitmap inherits from Image, but for fun
I
| > | thought I'd check the Doc and see what it says for Bitmap.FromFile. I
| > | expected it to say "(inherited from Image)". But I could find no
| > reference
| > | to Bitmap.FromFile anywhere in the help.
| > |
| > | There were times when I looked for something and couldn't find it so
I'm
| > now
| > | wondering if I'm expecting something that is not there.
| > |
| > | Is the help for Bitmap.FromFile someplace in the Docs and I'm missing
| > it?
| > |
| > | If I want the complete help on a class do I need to manually examine
all
| > the
| > | classes it inherits from?
| > |
| > |
| > |
| > | Thanks
| > |
| > |
| >
| >
|
|
Jan 24 '06 #5

P: n/a
got it, thanks
"Jay B. Harlow [MVP - Outlook]" <Ja************@tsbradley.net> wrote in
message news:%2****************@TK2MSFTNGP09.phx.gbl...
| Are you saying that if it is inherited but not Shadowed nor Overrode it
| would not appear in the help that shows the Bitmap methods?
I'm saying if its inherited, it will not show in the Index or Table of
Contents unless its Shadowed or Overrode.

Whether its Shadowed or Overrode or not, it will always show on the Bitmap
members page itself.

| But when I look at the site or my equivalent Help I don't see FromFile.
You
| do?
DOH! Bitmap members won't show it, as its shared! The above is for
instance members.

Although VB allows you to call shared members of base clases, only the
base
class has the Shared member. VB quietly changes Bitmap.FromFile to
Image.FromFile in the IL.
--
Hope this helps
Jay [MVP - Outlook]
.NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
" **Developer**" <RE*************@a-znet.com> wrote in message
news:uE**************@TK2MSFTNGP15.phx.gbl...
|
| "Jay B. Harlow [MVP - Outlook]" <Ja************@tsbradley.net> wrote in
| message news:ON**************@TK2MSFTNGP15.phx.gbl...
| > **Developer**,
| > Bitmap.FromFile is not in the help per se, as Bitmap itself does not
| > directly have a FromFile method, as you point out its inherited from
| > Image.
| > If Bitmap had Shadowed or Overrode FromFile, then help would have
listed
| > it.
|
| Are you saying that if it is inherited but not Shadowed nor Overrode it
| would not appear in the help that shows the Bitmap methods?
|
| >
| > What I normally do is look at the "Bitmap Members" page:
| >
| >
http://msdn.microsoft.com/library/de...mbersTopic.asp
| >
| > It lists all the members of Bitmap,
|
| I understood the above to mean it would not show unless it had Shadowed
nor
| Overrode - if so it would not show here
|
| including inherited members. I would see
| > that Bitmap FromFile is inherited, clicking the link would take me to
| > where
| > its inherited from...
|
| But when I look at the site or my equivalent Help I don't see FromFile.
You
| do?
|
| Thanks
|
| >
| > A lot of times I use the Object Browser to look for classes I may
need,
| > once
| > I find it in Object Browser I then refer to help to get more
specifics...
| >
| > --
| > Hope this helps
| > Jay [MVP - Outlook]
| > .NET Application Architect, Enthusiast, & Evangelist
| > T.S. Bradley - http://www.tsbradley.net
| >
| >
| > " **Developer**" <RE*************@a-znet.com> wrote in message
| > news:uy*************@TK2MSFTNGP15.phx.gbl...
| > | usually I'd do: Drawing.Image.FromFile(
| > |
| > | I noticed I once did without thinking: Drawing.Bitmap.FromFile(
| > |
| > | I assumed this worked because Bitmap inherits from Image, but for
fun
I
| > | thought I'd check the Doc and see what it says for Bitmap.FromFile.
I
| > | expected it to say "(inherited from Image)". But I could find no
| > reference
| > | to Bitmap.FromFile anywhere in the help.
| > |
| > | There were times when I looked for something and couldn't find it so
I'm
| > now
| > | wondering if I'm expecting something that is not there.
| > |
| > | Is the help for Bitmap.FromFile someplace in the Docs and I'm
missing
| > it?
| > |
| > | If I want the complete help on a class do I need to manually examine
all
| > the
| > | classes it inherits from?
| > |
| > |
| > |
| > | Thanks
| > |
| > |
| >
| >
|
|

Jan 24 '06 #6

P: n/a

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
" **Developer**" <RE*************@a-znet.com> schrieb:
usually I'd do: Drawing.Image.FromFile(

I noticed I once did without thinking: Drawing.Bitmap.FromFile(

I assumed this worked because Bitmap inherits from Image, but for fun I
thought I'd check the Doc and see what it says for Bitmap.FromFile. I
expected it to say "(inherited from Image)". But I could find no
reference to Bitmap.FromFile anywhere in the help.
In addition to the other replies: Note that 'Image.FromFile' is a shared
method and thus cannot be overridden in a class derived from 'Image'. I
strongly recommend to use 'Image.FromFile' instead of 'Bitmap.FromFile' as

agree, thanks
the latter will make the user think that the method's formal return type
is 'Bitmap', but instead it's still 'Image' and a cast is necessary when
the resulting reference should be assigned to a variable of type 'Bitmap'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jan 24 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.