Overlay Schriftart

theplake

Erfahrenes Mitglied
Hi Leut

Ich hab mir ein Overlay windows gebaut und dieses über meinen mmorpg prozess gelegt.
Ich lade das original ttf aus dem Font Ordner vom Spiel.
Code:
fontArray = Log_test.Properties.Resources.ttf_1;
                    dataLength = Log_test.Properties.Resources.ttf_1.Length;

IntPtr ptrData = Marshal.AllocCoTaskMem(dataLength);

                Marshal.Copy(fontArray, 0, ptrData, dataLength);

                uint cFonts = 0;

                AddFontMemResourceEx(ptrData, (uint)fontArray.Length, IntPtr.Zero, ref cFonts);

                PrivateFontCollection pfc = new PrivateFontCollection();

                pfc.AddMemoryFont(ptrData, dataLength);

                Marshal.FreeCoTaskMem(ptrData);

                ff = pfc.Families[0];
                font = new Font(ff, 15.75f, FontStyle.Regular);

Funktioniert auch alles wunderbar b

Allerdings sind weiße streifen um die einzelnen Buchstaben. Siehe Bild.Weiß einer wie ich die weg bekomme?
 

Anhänge

  • Unbenannt.jpg
    Unbenannt.jpg
    3,8 KB · Aufrufe: 7
Vielleicht hilft das bissl (unten die Antworten)
http://stackoverflow.com/questions/...border-on-a-windowless-application-in-c-sharp

If its a label or its a brush or pen, you need to change the Background property to Transparent

This is the inevitable side-effect of anti-aliasing. It only works when the background color is correct. When you rendered the text, the background was white. Making the text rendering engine draw pixels to blend from red/blue to white. Making those pixels starkly visible when the background isn't white. The workaround is to give up on anti-aliased rendering.
 
Zurück