Visual C#, How to display a `Unicode Character` in a label? - c#

I have a Label and I want it to display a musical note.
This Note.
The problem is, I dont have any of the fonts that can display this note.
The fonts with support are LastResort Quivira and Symbola.
How can I display this character and make it so the compiled program will be able to display this character on another computer?

Not sure what UI framework you're using (WPF? WinForms? Browser?), but could you use Graphics Software to make a PNG or GIF of the note and display it that way? If you include the image as an Embedded Resource it would be easy to deploy with you're app.
I also see from your link the image is available in SVG format. There are libraries available for rendering SVG in WPF and WinForms.

Related

Animated Icons in Windows Phone SDK

I am working on a weather app (for learning purposes) using Windows Phone SDK and C# as programming language.
I need to display an icon for each type of weather, for example, cloudy, raining, sunny, windy etc. I was wondering about what my options are.
I googled a little and found this. This is a Javascript library. Is there any way I can use this in my xaml page? If not, what are my options to show animated images in xaml?
No, you cannot use javascript based images in XAML.
You have several options here:
Use gif images (supported via third party components)
Use small videos (MediaElement)
Animate it yourself using XAML elements (hardest)
Use WebBrowser component and then import that js images (might also be hard)

Multilanguage support for images in .Net

I have a desktop app build using .net. I want it to support multilanguages. I am able to do that using resources. Issue is what should I do for images which have text? Should I include all images for separate languages? If so then this will make it difficult and also will increase its size.
I just read that in Android there is "9 patch image", isn't there something similar?
I wish to add background image, and write text on top of that. This background image should resize without change in quality of the image automatically to the size of text in that language.
I couldn't think of any way to avoid separate images with WinForms. WPF, no problem. Web app, no problem. I played around with both text and image on a Button control, but that does not scale fully. I tried using a label over a PIctureBox, but it is impossible to achieve transparency with a Label control. I also tried this using a WebBrowser control--such a thing could possibly work, but would take some further research and would probably change your deployment dramatically (since you would need to make the localization available from some http server).
So I think there is no easy way to do this--I could find nothing easier than maintaining the images separately.
In one of my projects, i had text displayed on top of images. Since the site was multilingual, so no text was part of the images. Instead text was displayed on top of the images, using css properties for absolute position. This had to be tested in all browsers, with multiple languages, as the text size varies in each language, this might break the UI. so enough space has to be provided for text considering all supported languages

Creating an image containing text with drop shadow using WPF, but inside a ASP.NET web app

Ok, I have a rather strange request.
Due to the inconsistency in how different browsers support text with drop shadow, I was thinking that the text I need with drop shadow (some headers), I could create dynamically on the server side of my web app, and then pass the image to the browser instead of text directly.
I want to use WPF for this, since WPF has a lot of text manipulation built in, and it should be significantly easier to make text with drop shadow in WPF compared to GDI+.
So what I need to do is inside my Web App, create a WPF text element with the drop shadow effect, and save it inside an image (either to disk, or better yes pass it directly to the browser since I actually do not need to store the image since it will be specific for that request only).
I'm hoping for at least some pointers in the right direction :)
I just want to say, since this is unanswered and I don't use WPF that much, GDI+ would actually be pretty easy:
Draw text on image using the desired color of the shadow.
Do a box blur (or Gaussian).
(optional) Create another bitmap and do basically a watermark style draw (this would allow you to set opacity and thus soften the shadow, etc.)
Draw text again using color desired for the text
With that you would have yourself text with a drop shadow. There's about 10 different image processing libraries that make it rather simple (I will sadly do some self promotion and just say that Craig's Utility Library has a draw text function and box blur function in the Utilities.Media.Image.Image class, but there's tons of other packages you could use).

FNT font file in C#

I would like to know if I can use FNT font file in c# .net.
FNTs are not windows font file.
If such fonts are available, can you please tell me how to load it and change windows form font to FNT?
I use .Net GDI+ technology, but please let me know if WPF is better for this.
Thanks,
Those are device fonts, a relic from the Windows 3.0 days before TrueType became available. They contain bitmaps of (typically) 256 glyphs in a certain character set at fixed pre-selected point sizes. They are not scalable beyond those fixed sizes.
Nope, neither GDI+ nor WPF supports them. You'd have to fall back to raw GDI to still use them. The file format isn't complicated, it would be technically possible to lift the bitmaps out of the file. I'm not aware of existing code, although I'm sure somebody did. Some kind of legacy font editor for example.
.NET uses either GDI+ (in WinForms) or WPF for its text handling and rendering.
So depending on what .NET technology you are using will determine what is supported.

Asp.net based image editor

I am looking for an image editor which can be incorporated into my asp.net application. My scenario is user select image from the image gallery and opens with the image editor, after edit the image and save it back on the web server. Image editor must have a paint brush. Crop and resizing of the image is not necessary.
I am looking for such a tools for the last 3 days, but not able to find any. I will go for paid software also.
If you want to do this on the browser, you will need to use something like flash. There are plenty of image editing components in flash - here is one.
See the answers to this SO quesion (Client-side image processing).
Apart from the Flash editors specified by Oded,
You can look at the Javascript + SVG based online image editor svg-edit. Its free.
I think you can take a look at picnik http://www.picnik.com/ .

Categories