SPONSORS:






User Tag List

Results 1 to 7 of 7
  1. #1
    Junior Member
    Join Date
    Mar 2002
    Location
    Chennai,India
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    getting icons from bitmap

    Hi..
    Is there a way to get the bitmaps present in menu items? In my AUT there are some menu items which contain bitmap. How do i extract the bitmaps??
    Thanks and Regards,
    rajesh

    ------------------

  2. #2
    Junior Member
    Join Date
    Mar 2002
    Location
    Chennai,India
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: getting icons from bitmap

    i'm sorry its not icons from bitmap icons from menu.....
    sorry for the confusion...

    ------------------

  3. #3
    Senior Member
    Join Date
    Nov 1999
    Location
    Eagle, ID,USA
    Posts
    1,035
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: getting icons from bitmap

    Thanks for clearing that up.

    What exactly are you trying to do? Are you trying to capture the icons? Trying to verify that they are there? Give more details

    ------------------
    Have you ever noticed? Anybody going slower than you is an idiot, and anyone going faster than you is a maniac.

  4. #4
    Senior Member
    Join Date
    Jul 2001
    Location
    Westford, MA, USA
    Posts
    160
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: getting icons from bitmap

    You're looking at a tricky bit of code. If you call into user32.dll (the call is GetMenuItemInfo), you can get a pointer to a menu item info structure which will include the MFT_BITMAP flag if the menu item has a bitmap. You can also get a handle to the bitmap itself. This is going to be tricky since mswfun32.inc does not provide you with an interface to GetMenuItemInfo. Once you have the handle to the bitmap, you'll have to figure out what to do with it -- I suppose you could compare it to a stored bitmap to verify it's the right one, but I haven't really thought that part out. If you're familiar with windows programming, go for it.

    ------------------

  5. #5
    Junior Member
    Join Date
    Mar 2002
    Location
    Chennai,India
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: getting icons from bitmap

    Hi Tony,
    I'm trying to capture the bitmap present in the menu and compare it with the bitmap i have stored.

    regards,
    rajesh

    ------------------

  6. #6
    Senior Member
    Join Date
    Nov 1999
    Location
    Eagle, ID,USA
    Posts
    1,035
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: getting icons from bitmap

    SilkTest doesn't allow you to use CaptureBitmap on a menu. You can try picking the menu and then call CaptureBitmap using coordinates as to where the menu item bitmap resides relative to the MainWin. For example:

    MainWin.Menu.Pick()
    MainWin.CaptureBitmap ("c:\check.bmp",{260,70,10,20})

    I was able to capture the check mark on a menu item this way. Unless someone comes up with a better way, this may be your only option.

    ------------------
    Have you ever noticed? Anybody going slower than you is an idiot, and anyone going faster than you is a maniac.

  7. #7
    Junior Member
    Join Date
    Mar 2002
    Location
    Kanata, Ont.
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: getting icons from bitmap

    I was looking to do some bitmap comparisons so that I could tell if my menu was currently displaying a "+" or "-" sign for a sub-menu title. Instead of grabbing the bitmap and comparing it to an image I already had stored, I decided to use the image's CRC.

    Something like this:
    iImageCRC = MyHtmlImage.GetBitmapCRC ()

    //if my image is one of my two possible "+" signs, then click on it to expand the submenu
    if (iImageCRC == 8056 | | iImageCRC == 26993)
    HtmlImage.Click ()


    The CRCs of "8056" and "26993" were determined by running a little case that determined the CRC of a bunch of images I was interested in at the time.

    I hope that helps!

    ------------------

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 05:28 AM.

Copyright BetaSoft Inc.