Transparent Circle inside a White Rectangle - image

I'm working on a report project and would like to avoid making a separate image for each indicator color. Ideally, I like to put a transparent circle in a white rectangle. I have Snag-It available and general Windows tools.
My plan is to put the Image in a table cell and change the color of the circle by dynamically assigning the background color of the cell. I think it would be much easier to embed this one image, rather than creating a bunch of different colored circles that all have to be embedded.
Any suggestions on how I can do this in Snag-It or Paint, or any tools that are free for commercial use that you can recommended for this?

This sounds like a good workaround to get an indicator with whatever color you want.
Paint.net is a free image editor that you could create this in. Start with a white square. Use the Ellipse Select tool to select a circle in the middle. Press the Delete key to make it transparent. Save it as a .PNG file and embed it in the report.

Related

Powerpoint change picture without changing cropping area

I´ve a cropped picture in a powerpoint layer and I want to change the picture without changing the size of the cropping area.
If I change the image by clicking "change picture" the cropping area resizes too, to show the whole picture.
How can I do that without changing the cropping area?
In Apple Keynote you only have to drag the picture you want to the cropping area and you only have to align it.
From my experience, I'm afraid you have to set the crop manually by "Format Picture" -"Crop" to remain the same cropping area when you replace a picture.
This isn't much help, but Libreoffice will do this. Crop, resize, then select your image and re-insert a new image - formatting will be the same, perfect for when you want to quickly redo formatting for same sized images.
In my experience, a picture that you insert to replace an existing one, using Change Picture, will "inherit" the crop&size settings of the old picture IF the old&new images are actually of the same size (in pixels) - if not, the new one will revert to the default crop&size so you will have to redo these manually.
This changes if the image to-be-replaced has any crop setting applied to it in Powerpoint. In this case, the replacing image will not inherit those, and might also be inserted with a different size&position, leading most likely to an unwanted result & further work needed.
A workaround I found is to first remove the crop setting from the old picture, replace with new image, then reapply the crop. This is still less work than having to manually redo the size&position (or to define these based on numbers copied from the PropertiesPane of the old image).
Quick work around: if you plan to have multiple same size images and you wish to use change image to swap the content on each page (something we do with floor plans all the time); don't bother cropping them.
Put the whole image in and crop it by sticking shapes on top of it, which are the same color as the presentation background color, like a mask.
optionally crop the images only when the whole presentation is finished.

Exported shapes as image with vba in powerpoint with a white space in the button and top

I want to export certain shapes in powerpoint as images. For that I am using the following code:
ActivePresentation.Slides(1).Shapes(3).Export "C:\dink_template\created_files\testimg.jpg", ppShapeFormatJPG
I also tried with other image formats:
ActivePresentation.Slides(1).Shapes(3).Export "C:\dink_template\created_files\testimg.png", ppShapeFormatPNG
and I get this image:
Here you cannot notice because the white peace that appears in the image button (and also a bit in the top) is mixing with the page but if you make inspect element on the photo you will see it.
As you can see in this other image in powerpoint the shape fix perfectly and it is not bigger that the image:
Why is appearing this white peace in the top and in the button? How can I export the image without them?
EDIT
I know when it is happening. Because I try with other ones and sometimes they where not appearing and sometime it was. The problem is that when the text you write in the shape is so close to the border and you export it as image it export with this white space. Now the question is... how can I solve this?
One option would be to adjust the size of your shape and/or the size of the text accordingly to the total text length, before exporting it as an image, in order to make sure that your text will never be too close to the border...
Something else: have you checked the margins properties of your shape? Putting them to 0 might help a bit.

Write in a transparent colour in expression blend (WP7)

I am trying to build a windows phone live tile. I want some text on the tile that is the accent colour. What this means is that I need to draw some text on the tile that is transparent. I don't seem to be able to write in the transparent colour.
I have a User Control which is 173 by 173 pixels which I save as a png file. I use this png as the image for the live tile. The transparent bits of the image come out in the current accent colour.
Any ideas how to write in the transparent colour in xaml?
This behaviour is to be expected. In your original question you are effectively saying "Write invisible text on top of the image", and that's what you're getting (imagine writing in invisible ink on a photograph). You effectively need to do one of two things.
1) Figure out which pixels are part of the text you're writing, and "remove" them from the image so the background colour shows through, or
2) Write text in the background colour ({StaticResource PhoneAccentBrush})
EDIT
You can probably achieve what you need using an Opacity Mask. Apologies for only providing that as a link as I haven't done this myself.

How do you set pixels to be transparent in a .GIF or .PNG file in Visual Studio 2008's drawing editor?

My graphic artist gave me a .PNG file, then the same file as a .GIF. When I save it, the transparent background pixels actually get set to white pixels. At one time I thought VS could do transparent colors with this little pink/salmon retro-tv looking icon in the color palette, but it's not showing up any more.
Anybody have any ideas?
Open the file gif/png with the Visual Studio Editor
In the properties window select a format that supports the alpha channel i.e. 32bpp BGRA
Using the eraser tool now will set those pixels to transparent.
In Visual Studio 2015 image editor, I found an easy way to do this with the eraser tool.
First fill the background which you want to make transparent with an adequately unique color(not really necessary I think, after some trials.. It's up to you to try) that is not in the picture.
Then select the tool used to 'select an area of similar color'.
Then click on the background you filled with new color. Only the area you need to make transparent will be selected.
Now use the eraser tool with as much size(erase width in properties) as you want to easily erase the opaque background. The eraser won't erase the picture you need.
Then click outside the picture to clear the selection and you get the picture with the transparent background! This method just takes seconds to finish, as compared to using just the eraser tool. Just sometimes, you may need to touch up the picture, as some minor part of required image may be cleared.
NOTE: You must set the format to '32bpp BGRA' to do this.
EDIT: I found that you don't even need an eraser tool. After step 3, press delete, and the background is gone!
In the VS 2013 image editor, the following works for me:
Select View-Toolbars-Image Editor so that you can see the toolbar
Select the eraser from the toolbar. Set the erase width in the property window to 1
Now clicking ("erasing") a pixel will set it to transparent
The VS eraser tool was working but taking way too long for my image. This tool automatically made my white background transparent when I uploaded the png version.
https://www.bonanza.com/background_burner
Drag and Drop image on page (then the page does some processing to
the image)
Click green download button on bottom right and select .png
(transparent background)
Pros:
Free
Super fast
Online tool so nothing to download
Con:
Image needs to be at least 100 x 100px
I'm just using it for an intranet web app so I didn't need to put much time in or make it great quality.
In the VS2019 image editor you can also use the "M" key on the keyboard to select an area of an image based on color, and then use the delete key.
If you have access to Microsoft Visio you can Import/Create the graphic object that you want to have some transparent pixels, make some or no changes to it and then Save As Type .png file.
After you hit Save As a PNG Output Options pop-up appears.
It gives you a Tick box to select the Transparency color (ie color you want to make transparent).

Get theme properties of Group Box lines

My goal is to draw a Group Box that is not rectangular but instead has the corners cut away. I do not mean just clipping the corners, but rather have a continuous closed path where the corners are "indented." I want this to match the colors/style of the current theme.
I noticed on Windows XP that the Group Box has 1-pixel gray lines, but on Windows 7 there is a 3D effect created by having a gray line next to a white line (the white line on the interior except on the bottom where it's below the gray line).
You can get the color of the text label of a Group Box using something like this:
COLORREF cref;
GetThemeColor(hTheme, BP_GROUPBOX, GBS_NORMAL, TMT_TEXTCOLOR, &cref);
So, I'm trying to figure out how to get the color(s) and/or properties of the lines used in a Group Box, then (I hope to) be able to draw the lines I want matching the Group Box style by separately drawing each piece of the shape I want. I'm not sure what properties are used to describe the lines or if functions line DrawRect will draw the 3D effect with a suitable Pen. Is there a way to set a Pen to draw these 3D effects (2-shade parallel lines)?
Thanks.
The thing I always find unexpected about groupboxes is that they are really a style of buttons. (BS_GROUPBOX).
Themed groupboxes (XP and later with classic mode off) use theme part BP_GROUPBOX in VSCLASS_BUTTON. You can use the usual theme APIs to get and draw. If your Group box needs text you can use DrawThemeText.
There are APIs for drawing non-themed group boxes too (e.g. DrawEdge), but I don't remember the details and it's unlikely that you need them.
As usual, I will point out that reproducing the behaviour of controls is always harder than you think it is going to be.
Martyn

Resources