Retaining Alpha channel on buttons in Outlook Toolbar - vb.net

I am developing a COM Add-in using VB.NET in Visual Studio 2008 Pro for Outlook 2003 and am having trouble assigning images to custom toolbar buttons.
In a nutshell, I am having to convert from an Icon type to a stdole.IPictureDisp type so that I can assign my buttons a picture.
The picture displays, but it loses the Alpha channel and the background is no longer transparent. I can verify that before the conversion to IPictureDisp object, that the PixelFormat property is set to Format32bppArgb (2498570). I am using a coding technique suggested here: http://msdn.microsoft.com/en-us/library/ms268747%28VS.80%29.aspx.
For C# users, this link blogs.msdn.com/andreww/archive/2007/10/10/preserving-the-alpha-channel-when-converting-images.aspx (sorry I am newbie and can't post more than one link! Dumb rule BTW) shows how to modify the IPictureDisp one pixel at a time and rebuild the transparency, but I can't find similar functions in VB.NET...
I would appreciate any advice regarding this. Thanks.

If you read to end of the article the author notes in one of the comments that the command bars API doesnt support alpha channels on images. You can of course cheat a little, if you draw your image onto a bitmap that matches the background of the toolbar and assign that composite image to the toolbar button, you would have a toolbar image that "looks" transparent.

Related

How to Round Out the Corners of a Rectangular Button on .axml (Visual Studios 2019, Xamarin Forms)

I am newer to coding but, usually, when I have a question it is answered by a quick google search or video explaining my issue. The title is basically the question but I will elaborate: How do you round out the corners of a rectangular button in .axml? I have tried making a drawable folder with specific corner parameters set and applying that to the button background but it doesn't change the button in any way. I know that in .xaml you can simply use the CornerRadius tag but that isn't defined in .axml. Sorry if I am not being specific enough with my issue, like I said, I am new, but would be willing to elaborate further if need be.
Thank you all:)

Want To Create A Floating Speech Bubble Form

Wondering if someone could help me....
I have a small .NET application where I have an Edit button on a main form. When the user clicks the Edit button, I want to popup a small form right next to it (on top of the main form) with a speech balloon tail attached on the side of the form pointing to the Edit button. So it gives the effect of a floating form pushed out from the Edit button.
I don't want the appearance of a normal speech bubble, I want it to look like an actual borderless form (with square corners). It could be a custom control or anything (however, I am not yet familiar with creating my own custom controls), but I need to add Text Controls, Pictures, Label Controls, etc. to this floating form.
Any help would be appreciated.
Thanks
UPDATE
I am trying to create something to this affect:
So imagine the ? being the Edit button and the other being a form with custom controls.
Like this?
To get this behavior:
Select an image which will represent your speech bubble. Put a PictureBox on the form, make it use this image. Place two labels, as above, adjust the font.
Pick your transparency key (color). Your image background and form background need to be set to that. I used black for demo purposes, which is a bad choice if you plan to have any black or text in your speech bubble. Set form's TransparencyKey property to this color in designer. More about TransparencyKey on MSDN.
(final step, not shown on the screenshot). Set FormBorderStyle = None.
Also make sure you have other ways to close your bubble, because X will be unavailable.
The final result may look something like the following:
Note: You may notice some drawing artifacts, most images on the internet have smooth borders, and transparency key does not support shades, has to be exact color. If you are fine with these minor artifacts, feel free to leave it at that. Or, edit it to get rough borders. Or find another one that better suits your needs.

iOS Text Wrapping

In the app I am currently developing, I have to implement a screen which allows the user to ask a question. This screen contains a UIImageView next to the UITextView, taking up a portion of the space. It looks like the below image.
My question is, how can I wrap the UITextView text around the UIImageView, so that the text won't be in a block, but flowing around the UIImageView?
Thanks in advanced.
I don't think you can do this, unless your UITextView was a rich text or HTML editor, with the image embedded inside it. Basically what you're asking for is a non-rectangular UITextView. To the best of my knowledge, that is impossible in iOS, unless you were to create something brand new from scratch, which would be extremely complex. I have seen plenty of UILabel-style controls that can display HTML-like text, but not edit it.
EDIT: this might help: http://www.cocoanetics.com/2011/01/rich-text-editing-on-ios/
Unfortunately that's not a trivial issue as the UITextField does not provide any functionality that would be useful here.
However what you could do is to implement your own text view using UITextInput (for text input) and Core Text (for text display) and then define the drawing rectangle for Core Text (you can read more on Core Text here) from a custom CGPath that would exclude the images frame.
It does sound a bit complex (insane, perhaps), however as (nearly always) there are open source solutions that already found a solution. The OmniGroup framework contains custom text input controls based on Core Text and UITextInput. They're licensed under MIT License (well, moreless) so you should be just fine.

What's the best way to get around the lack of transparency in WixUI background images?

I'm using the Feature Tree UI, with a couple of custom dialogs. One of these has checkboxes on it. These checkboxes cannot be made to have transparent backgrounds, meaning I've had to colour in my background image the default background colour so that there aren't visible boxes around the checkboxes.
However, different versions of Windows have different default colouring! If I match the colour on Windows 7, it looks bad on XP, etc. Since the background images are Bitmaps, I can't make them transparent. What can I do to get around this problem?
From the WiX tutorial UI revisited chapter:
And a common complaint: no, the checkbox can't have a transparent
background. If you have a bitmap in the background, it will be ugly,
just like in our example above. The only workaround is to reduce the
width of the checkbox to the actual box itself and to place an
additional static text (these can be made transparent) adjacent to it.
This workaround has a side effect, although: in order to turn the checkbox on and off, you should click exactly in the box area, not the text. Comparing to the rest of Windows Installer UI limitations, it's slightly annoying :-)
Windows installer supports 32-bit bitmaps (ARGB), which means that the bitmap can be made transparent to show the default windows background color. This means, once your (not transparent) check-box is placed on top, you won't see the ugly box around the text, because it's the same color.
Note that windows photo viewer and the thumbnail preview in explorer DONT support transparencies, so you'll have to build and run your installer to see it working =D.
I used gimp to export to BMP with a transparency and it worked just fine with WIX.

can we place a picture in a picture box in differrent place?

i am using vb.net
i just wanna ask if we can place a picture in a picture box in different places...
for example, we place a picture in the center of a picture box then we place another picture on the left side of the picture box. is it possible??
and also can we use one picture box that can contain more pictures or images on it???
to make it clear, it is a drag and drop senario, first you have to drag a picture from a toolbar for example, then you are to drop it on the picutre box, the problem is, we have to drop more than one picture in the picturebox, so is it really possible?
To my knowledge, this is not possible with the standard .NET picturebox control.
You could, however, create a custom control that would encompass this functionality.
I'm thinking it wouldn't be too complicated to do.
But probably the best way to handle it would be to create your picture box controls programmatically.
EDIT: Found something that might be useful for you, on CodeProject. Its a extended picturebox control, that seems to have multiple pictures in it.
Extended Picturebox
You will need to build all this functionality from scratch no matter which control you're using. You can use Picturebox, Button, Panel and so on, and they'll all provide the same fundemental for building the required functionality. I would suggest that you used a panel/canvas though. And as Jon suggested, subclassing a panel to create a custom control would properably be the best idea.
Inside this custom control, you will need to keep track of which images that have been dragged into the control, which images is affected by several mouse actions such as click, hover and release, and you will need to draw the pictures manually.