Words in transparent PNG have jagged edges - c#

I've built an app which uses transparent PNGs to display an overlay for users to tap using WPF and C#. However, there are weird jagged edges around the words. Would this be more of a C#/WPF limitation or a Photoshop issue?
Screen resolution is 720p. App runs on win7pro.
Screenshot:

Definitely a problem with the image itself. I see the same fringing when viewing the image against a black background on my phone. Make sure you compose the text over a transparent background (i.e., don't remove the background with a magic wand tool) and save with a full alpha channel (32-bit PNG).

Related

How to make a Form of Winforms and pictureBox control display png images transparency without the outline?

I have an application using png type and GIF with transparency in the background. So I want to display them in Winforms using PictureBox, but they still have the outline or something outside the images that seem unclear as photoshop does. I have attached the example below.
As you guys can see the image has something outside that looks so annoying, can you guys help me figure out how to fix or improve It? I appreciate that.
Below is the original png that I used in my project
enter image description here
The problem is that the image is not fully transparent where you think it is.
The problem when taking an image and removing the background with transparency is that you often use the magic wand and it works for 99% but the rest you have to fix manually.
What I personally prefer in these cases is that you take your image (the png version with transparency) then in Photoshop you add another layer and put the first layer with the image on top. Then you change background color on the second layer (the one you just created) with a strange color in regards to the image, so in this case i would test with yellow.
Then if you have everything correct you should not see your image and since part of it is transparent you will see the yellow color where the image is transparent. Now you can zoom in and check the "strange parts" of the image and then you will find the spots that are not transparent. Now you can use the eraser or magic wand and polish the edges so that you only see yellow where it should be transparent. When you are done you could test and change the yellow color on the second layer to red and just double check. Then it will probably work as a charm. Good luck! If it does not work after that, please give us more details and also add the png image.

Image with transparency over video

Im using C# in VS2017 and have a Vlc Control to play a video.
I want to overlap some part of the video with a PNG image with transparency. In VS2017, elements are transparent to their parent. So, to make the image be transparent to the video I have to set it as child of the video.
But if I do that, the image doesn't display at all. Video is always refreshing and overlapping the image (even if I do a constant BringToFront in the image).
So, I change the Parent of the image to the form. Now the image displays, but through it's transparency I see the form's background, not the video.
Target platform is Windows. Is there any solution for this?
I had this same problem with windows forms. I believe there is no simple solution where you can use another control (e.g a picturebox) and make it transparent such that you can see the video behind it.
One thing you can do is to create another form, set it as topMost, set it's MDiParent to the form containing the VLC control and set its FormBorderStyle to None. Then set it's background to be the image you want to overlay and set it's opacity property to say 50%. This should give you the effect you want but it is a bit of a work around.
If you can you should move to WPF as your UI technology which should solve this and allow you to overlay a picture box with a transparency that doesn't just show the background of the main form behind it and actually shows the video.
It's not very clear how you're using libvlc.
Do you have to blend the image with the control itself? Shouldn't you blend any given image with the video frames?
If so, try using --alphamask-mask filter:
--alphamask-mask=<string>
Transparency mask
Alpha blending transparency mask. Uses a png alpha channel.
If you're using libvlc.net you can do this by adding an option:
vlcContext.StartupOptions.AddOption(<options>);

Blur Effect : Silverlight Windows Phone 8.1

I am writing windows phone 8.1 silverlight app,
I have a Stackpanel in my XAML page, I want to create its background "Blur".
Is there any way to do it?
There is no easy way to apply effects such as blur to elements. More typical would be to dim them by placing a partially transparent rectangle over the disabled element.
If you really want blur you would need to render the element to a bitmap, but the bitmap contents, and then place that image over the original element.
If you have an image as background you could add the blurred effect by modifying the image before setting it as background.
There's multiple libraries that allow you do to this eg. Win2D and Lumia Imaging SDK 2.0.
They are both fairly simple to work with and have pro's and con's.
Nokia Imaging SDK allows you to work directly with bitmaps / writeablebitmaps while Win2D has a more smooth blur rendering.
Here's a guide to how you can implement and work with both: http://www.blendrocks.com/code-blend/2015/1/29/implementing-image-blur-in-a-windows-universal-app

WinForm transparent image issue

I have a WinForm and I set a transparent PNG image for the label. In Windows XP, the transparency displays properly, but in Windows 7, the white text (as seen in the example URL below) becomes transparent (it should be solid white). I'm also wondering if there is a way to smooth the edges of the transparent image so it isn't as choppy.
label1.Image = global::WinProgram.Properties.Resources.image_name;
Example:
Due to your limited code, I'd be guessing on this one but i find this very likely to be your problem. In WinForms there is a so called TransparencyKey, I'm guessing that you sett'd the SolidWhite as your TransparencyKey.
You can refer to this post: Transparent Background

Cant get drop shadow as per PNG image in C# background image of form

I've form in .net C#,
Problem:
I've a PNG image with drop shadow and I want put that image as back ground image of form and also using transparency key as well with the same background color property. But when I debug my app it does not give expected drop shadow as per png image. Please help me.
You'll probably need to programmatically adjust the transparency of the image.
Background images on a form do not support any photo attributes/editing, just set or get. So you'll need to get your photo and the background color of the form, and then programmatically change the photo to look as if it is transparent to the background color of the image.
Then take the image and set it as the background image of the form.
But without more information, I'm not sure what else to say or if I've said the right thing.
I have a better solution.
ModernUI Theme for .Net WinForms supports two kinds of Shadow Effects. See
image below.
WinForm ModernUI
It's under MIT on GitHub:
https://github.com/NetDimension/WinForm-ModernUI

Categories