Professional Web Applications Themes

How to use icon instead of bitmap for image on button in toolbar? - Adobe Acrobat SDK

Hello, I am trying to use an image that has a transparent background on one of the buttons on our custom toolbar in Adobe Acrobat. In the past we have been using the following code with Bitmaps to display the image and it has worked perfectly: ================================================== ==================== AVIcon icon = LoadBitmap(gHINSTANCE, MAKEINTRESOURCE(IDB_OPTIONS_LARGE)); toolButton = AVToolButtonNew(ASAtomFromString("IMGR:Options"), icon, true, false); ================================================== ================== Background info on the other objects: V0200_DATA* dataPtr = (V0200_DATA*) windowsData; gHINSTANCE = dataPtr->hInstance; Resource File: IDB__OPTIONS_LARGE BITMAP "Resources\ImageOptions_Large.bmp" IDI_ICON1 ICON "Resources\Image_Icon.ico" Unfortunately, these bitmaps are not transparent and end up showing the white background instead of the transparent ...

  1. #1

    Default How to use icon instead of bitmap for image on button in toolbar?

    Hello,

    I am trying to use an image that has a transparent background on one of the buttons on our custom toolbar in Adobe Acrobat.

    In the past we have been using the following code with Bitmaps to display the image and it has worked perfectly:

    ================================================== ====================
    AVIcon icon = LoadBitmap(gHINSTANCE, MAKEINTRESOURCE(IDB_OPTIONS_LARGE));
    toolButton = AVToolButtonNew(ASAtomFromString("IMGR:Options"), icon, true, false);
    ================================================== ==================

    Background info on the other objects:

    V0200_DATA* dataPtr = (V0200_DATA*) windowsData;
    gHINSTANCE = dataPtr->hInstance;

    Resource File:
    IDB__OPTIONS_LARGE BITMAP "Resources\\ImageOptions_Large.bmp"
    IDI_ICON1 ICON "Resources\\Image_Icon.ico"

    Unfortunately, these bitmaps are not transparent and end up showing the white background instead of the transparent one.

    I have tried using Icons and PNGs as my image but I have been unable to get anything to show up. Here is the code I am using to get the AVIcon:

    ================================================== =================

    AVIcon icon = LoadImage(gHINSTANCE, MAKEINTRESOURCE(IDI_ICON1), IMAGE_ICON, 0, 0, LR_DEFAULTSIZE);

    ================================================== =================

    However, no image appears on the toolbar. I am able to use LoadImage with the bitmap, but I am unable to make it transparent, even when using the LR_LOADTRANSPARENT flag.

    If anyone can point me in the right direction I would greatly appreciate it!

    Thanks,
    Ryan
    GRyanTaylor@adobeforums.com Guest

  2. #2

    Default Re: How to use icon instead of bitmap forimage on button in toolbar?

    There is a sample in the Acrobat SDK (8 and later) that demonstrates how to use a PNG - with transparency.
    Leonard_Rosenthol@adobeforums.com Guest

  3. #3

    Default Re: How to use icon instead of bitmap forimage on button in toolbar?

    Hi Leonard,

    I looked in the 8.1 SDK but I couldn't find anything dealing with transparent images on the toolbar. ( did a textual search for png)

    The only examples that I found were relating to BMP and cursors.

    Could you be more specific in where to look exactly?

    Thanks,
    Ryan
    GRyanTaylor@adobeforums.com Guest

  4. #4

    Default Re: How to use icon instead of bitmap forimage on button in toolbar?

    Hi Leonard,

    Thank you for your time. Were you able to find the location of these examples?

    Thanks,
    Ryan
    GRyanTaylor@adobeforums.com Guest

  5. #5

    Default Re: How to use icon instead of bitmap forimage on button in toolbar?

    I seem to recall it was added in R2 or R3 of the 8.1 SDK...Might need to check the 9 SDK...
    Leonard_Rosenthol@adobeforums.com Guest

  6. #6

    Default Re: How to use icon instead of bitmap forimage on button in toolbar?

    Hi, I have the same problem, Id like to use transparent pictures(png) or icons (ico) on my toolbar button.

    It works fine with bmp :
    //AVIcon myIcon = LoadImage(gHINSTANCE, bmpPath, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION );
    tButton = AVToolButtonNew (ASAtomFromString(bName), myIcon, FALSE, FALSE);

    But ends up with no picture on the button if I use :
    //AVIcon myIcon = LoadImage(gHINSTANCE, picturePath, IMAGE_ICON, 0, 0, LR_LOADFROMFILE );
    tButton = AVToolButtonNew (ASAtomFromString(bName), myIcon, FALSE, FALSE);

    Couldn't find anything in the Acrobat 9 SDK. I'm actually using Acrobat 7 SDK for my development.
    nicolas_PUSET@adobeforums.com Guest

  7. #7

    Default Re: How to use icon instead of bitmap forimage on button in toolbar?

    I don't believe that Acrobat 7 supported transparent backgrounds - but it's been a while. I know that Acrobat 8 and later, do...
    Leonard_Rosenthol@adobeforums.com Guest

Similar Threads

  1. Replies: 3
    Last Post: July 16th, 02:13 PM
  2. Replies: 5
    Last Post: May 11th, 05:11 PM
  3. MS OFFICE -- Toolbar there but icon image NOT. What's the deal???
    By Biz_Notch@adobeforums.com in forum Adobe Acrobat Windows
    Replies: 8
    Last Post: May 10th, 10:36 PM
  4. how to make button with a little image icon
    By David in forum ASP.NET General
    Replies: 3
    Last Post: August 5th, 04:48 PM
  5. Customizing toolbar icon greyed out ?
    By ace_freely webforumsuser@macromedia.com in forum Macromedia Freehand
    Replies: 0
    Last Post: July 21st, 09:13 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139