Write in a transparent colour in expression blend (WP7) - windows-phone-7

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.

Related

Creating solid color icons on macOS leads to off-color pixels on the bottom

I've been trying to create icons without transparent backgrounds, but I keep getting strange results. For example, when I make icons with white backgrounds, their bottom rows will wind up with yellow pixels.
Steps to reproduce:
Create a square PNG file with solid white.
Right-click on any application and select Get Info.
Click-and-drag the PNG file to the application's icon in the upper-left.
Notice the icon has a strip of yellow pixels on the bottom.
I was having trouble creating Finder icons to match the macOS aesthetic, so as a test, I tried making icons without transparency. But then I ended up with a new problem.
It sounds like what you're talking about is a quirk with the Apple Icon Image format. If you read the Wikipedia entry on ICNS files there is this known issue: "if the last value is a repeating byte (see Compression). Potentially, up to 130 pixels can lack the blue channel value." So, in RGB, if you remove B, you get yellow, which is likely what you're seeing.

Transparent Circle inside a White Rectangle

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.

How to add an image with transparency to a TDbgrid column in delphi?

I am trying to add an image to a column on a TDbgrid that takes transparency into account. When drawing the image from a TImageList on the canvas in the DBGridDrawColumnCell procedure, I need the background of the image (the same color as the pixel in the lower left corner) to take on transparency. I want this transparency area to show the highlight color or non-highlight color, especially when themes are used, such as Aero. I have been able to accomplish this in older versions of Windows with color values of clHighlight or clWindow as the background color. But with Aero themes, it always paints a box behind the non-transparent part of the image instead of the gradient blue highlight color that Aero uses. How can I accomplish this?
I believe I am supposed to use alpha channel but I'm not sure how to do this from a TImageList to a canvas. I believe the cell is painted completely with the actual highlight color before I start drawing on the canvas in the cell. I just want to draw the non-transparency part of the image and leave the background.
I was able to finally determine how to display images on a dbgrid with transparency even if themes, such as Aero is used.
I used a regular TImageList and loaded the images that I needed to display on the dbgrid. In my case there were two and they were in icon (ico) format. Instead of transferring the image to a bitmap and then drawing it to the dbgrid canvas as most old code recommends, I simply used the following simple code in the DBGridDrawColumnCell procedure:
if DataCol=0 then
begin
if (MApptsConflict.Value='<none>') then
ImageIndex := 0
else
ImageIndex := 1;
ImageList.Draw(TDBGrid(Sender).Canvas,Rect.Left+2,Rect.Top+2,ImageIndex,True);
end;
This will draw directly to the dbgrid canvas from the TImageList which will give the desired transparency.
UPDATE: I tried it with bmp's loaded in the Timagelist and it worked too.

Delphi PNGImage - Image transparency is not pure

I am using PNG images as main image resource in my application. Since im using Delphi 7, i downloaded PNGImage lib and included it in project. I load images like this:
Form.image.Picture.LoadFromFile(PAnsiChar('\background.png'));
Image has transparent and semi transparent pixels on its border. The problem i get is that transparent pixels are filled with random zoomed part of my desktop with currently opened windows, while i expected to see what is actually located beneath form.
Additionally, form has this properties:
BorderStyle: bsNone;
TransparentColor: true;
Visible: false;
Here is a picture of current state (above black line) and desired:
Can this be fixed somehow or it is how delphi deals with transparency?
To have the form "shade" what's beneath it, use the forms AlphaBlend and AlphaBlendValue properties. The .png image doesn't have to be partially (alpha blended) transparent, but it can be.
If you want the form to be semi-transparent you use Alphablending, that's a limitation of Windows. In addition you can have a certain color fully transparent. In the following sample the forms color is clGray, which is also defined as the Transparent color property in addition to the Transparent property set to True. The image, aligned alClient, is 50% transparent, placed on a TImage which is set as transparent, but even so, it doesn't show up as semi-transparent unless you have AlphaBlending on. Again, this is a limitation of Windows. The best you can do is try with a fairly high value for AlphaBlendingValue (240..250) and a rather light image to find the right compromise.

Change white png image to specific colour

I have a white png image, which is a part of a n icon.
I would like to change it's colour to get a coloured icon.
I know it is possible with hue/saturation setting, but don't know how to achieve a specific colour output.
I am using Axialis Icon Workshop (I have Photoshop CS5 also). The colourize option along with Hue, Saturation and Brightness adjustments will assist getting any colour output. But I specifically want colour #3366CC.
Is there a solution to convert my white png image to #3366CC coloured image?
This can be easily achieved if you go to the layers panel in Photoshop and select your icon layer. If the icon has a transparent background then select the fx button from the bottom of the layers panel and select color overlay or go to the menu at the top of the Photoshop screen and select Layer > Layer Style > Color Overlay. From the options box select the color box and put in 3366cc instead of the ffffff you have.
This should give you a coloured icon as desired. If this doesn't work let me know and I'll try to help.
You can go to layer style and choose color overlay, but that wont give you the color as you exactly want it, you can go a step further and hold the control key and click on the shape or the image you want to change the color, the shape will be selected, make a new layer on top of the shape or image that you want to change the color then fill in the color with the color that you choose in the layer property and set the mode to overlay, reduce the opacity to 50%. done

Resources