|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
A question about finding class methods in the HelpI 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 **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/default.asp?url=/library/en-us/cpref/html/frlrfSystemDrawingBitmapMembersTopic.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... -- Show quoteHide quoteHope this helps Jay [MVP - Outlook] ..NET Application Architect, Enthusiast, & Evangelist T.S. Bradley - http://www.tsbradley.net " **Developer**" <REMOVEdevelo***@a-znet.com> wrote in message news:uy5BZsPIGHA.532@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 | | "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_***@tsbradley.net> wrote in Are you saying that if it is inherited but not Shadowed nor Overrode it message news:ONHiqEQIGHA.2628@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. would not appear in the help that shows the Bitmap methods? > I understood the above to mean it would not show unless it had Shadowed nor > What I normally do is look at the "Bitmap Members" page: > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDrawingBitmapMembersTopic.asp > > It lists all the members of Bitmap, 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 But when I look at the site or my equivalent Help I don't see FromFile. You > where > its inherited from... do? Thanks Show quoteHide quote > > 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**" <REMOVEdevelo***@a-znet.com> wrote in message > news:uy5BZsPIGHA.532@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 > | > | > > | Are you saying that if it is inherited but not Shadowed nor Overrode it I'm saying if its inherited, it will not show in the Index or Table of | would not appear in the help that shows the Bitmap methods? 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. DOH! Bitmap members won't show it, as its shared! The above is for You | do? 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. -- Show quoteHide quoteHope this helps Jay [MVP - Outlook] ..NET Application Architect, Enthusiast, & Evangelist T.S. Bradley - http://www.tsbradley.net " **Developer**" <REMOVEdevelo***@a-znet.com> wrote in message http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDrawingBitmapMembersTopic.aspnews:uE3Z4HRIGHA.3896@TK2MSFTNGP15.phx.gbl... | | "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_***@tsbradley.net> wrote in | message news:ONHiqEQIGHA.2628@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: | > | > Show quoteHide quote | > | > 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**" <REMOVEdevelo***@a-znet.com> wrote in message | > news:uy5BZsPIGHA.532@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 | > | | > | | > | > | | got it, thanks
Show quoteHide quote "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_***@tsbradley.net> wrote in message news:%234vJoXRIGHA.1288@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**" <REMOVEdevelo***@a-znet.com> wrote in message > news:uE3Z4HRIGHA.3896@TK2MSFTNGP15.phx.gbl... > | > | "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_***@tsbradley.net> wrote in > | message news:ONHiqEQIGHA.2628@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/default.asp?url=/library/en-us/cpref/html/frlrfSystemDrawingBitmapMembersTopic.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**" <REMOVEdevelo***@a-znet.com> wrote in message > | > news:uy5BZsPIGHA.532@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 > | > | > | > | > | > > | > > | > | > > " **Developer**" <REMOVEdevelo***@a-znet.com> schrieb: In addition to the other replies: Note that 'Image.FromFile' is a shared > 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. 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/>
Show quote
Hide quote
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message agree, thanksnews:%23Ii6RQRIGHA.216@TK2MSFTNGP15.phx.gbl... >" **Developer**" <REMOVEdevelo***@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 Show quoteHide quote > 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/>
UGH, Framework goes just so far AGAIN!
GUI Design Question URGENT: Problem when iterating through a custom collection (dictionary based) with FOR...EACH WEBREQUEST AND WEBRESPONSE PROBLEM Assigning a Value to a Structure Pointed to by a Tag ? Problem when iterating through custom dictionary based collection with FOR...EACH...NEXT Process output redirection? Using a VB.net dll in VB6 How to know if a file is ready. online help goes back in time |
|||||||||||||||||||||||