It is not possible for me to draw it in a smooth way. I looks always kind of ugly. Is it nowadays possible to draw Text in a Year2020 quality ?
I tried so many tips and tricks but nothing has worked so far...
Hello, I don't think there is a problem with any font that Windows can handle.
Please post your current code (if possible attach a working sample project).
surely you are with a DPI above 100, if you want to have better resolution you have to make your application compatible with dpi, there are many threads in the forum on how to do it.
I played a little with the fonts-properties (CreateFont-API) and now I guess I have a good result for VB6-Conditions. It has the same "Quality" as e.g. in regular Textboxes. But it is still not smooth as in popular applications or browsers (this current text for example) . It looks "Windows-XP-ish" especially in smaller fontsizes. What would be the best way to draw a text as smooth as it could be ? Do I need to use Direct-X or other technics to achieve that ? There are also some things that I do not really understand. When I use the Fonts-AntiAliasing-Flag for "lfQuality" the Text becomes really ugly. With PROOF_QUALITY it works okay.
Here is my font:
Code:
With lfFont
.lfHeight = -MulDiv(12, GetDeviceCaps(UserControl.hdc, LOGPIXELSY), 72)
.lfWeight = 400
.lfCharSet = DEFAULT_CHARSET
.lfOutPrecision = OUT_DEFAULT_PRECIS
.lfClipPrecision = CLIP_DEFAULT_PRECIS
.lfQuality = PROOF_QUALITY
.lfPitchAndFamily = DEFAULT_PITCH Or FF_DECORATIVE
.lfFaceName = "Tahoma"
End With
I do program with Xamarin and C#WPF and that all looks so nice...
I really would like to pretend that my VB6 Applications are still modern ! ;-)
DPI was asked about, but not answered. Are you having problems at all DPI settings, i.e., 100%, 125%, etc, or just DPI settings above 100%?
The scaling and results are just fine in every resolution. Maybe my expectations are too high. If there is no other way to get better results than just "DrawText" than this is it.
DPI was asked about, but not answered. Are you having problems at all DPI settings, i.e., 100%, 125%, etc, or just DPI settings above 100%?
The scaling and results are just fine in every resolution. Maybe my expectations are too high. If there is no other way to get better results than just "DrawText" than this is it.
I attached an Image to this post but it looks bad in the preview. But I hope you can see the difference. Even the demanded color (VBWhite) is not really white in comparison to the color I used in my Screenshot-Editor.
I have to make clear that I am obvious no expert of such things. It is still a mystery for me, why my "Tahoma 12pt" is looking completely different to the Editors "Tahoma 12pt", but that is another matter...
The screenshot is taken from a 4K resolution with 175%
If dilettante's suggestion does not fix the problem...
... The screenshot is taken from a 4K resolution with 175%
Compare only at 100% unless your IDE (or compiled exe) is manifested as DPI-aware and/or scales fonts. If your screenshot is from a non-DPI aware test and scaled to 175%, then DPI virtualization may be the reason for the fuzziness. When testing at 100% DPI only, you can screen-capture text areas and paste into MS Paint and then zoom that to help compare.
Insomnia is just a byproduct of, "It can't be done"
If dilettante's suggestion does not fix the problem...
Compare only at 100% unless your IDE (or compiled exe) is manifested as DPI-aware and/or scales fonts. If your screenshot is from a non-DPI aware test and scaled to 175%, then DPI virtualization may be the reason for the fuzziness. When testing at 100% DPI only, you can screen-capture text areas and paste into MS Paint and then zoom that to help compare.
That seems to be the main problem. On 100% it looks much better. But in my VM-Ware with 2560x1440 and 100% it still looks "bad". It is the first time I hear about a "DPI-Manifest". Maybe I have to google a little bit more.
At this point I want to thank you and all the others who answered me already ! I really appreciate it !
If you are using any fairly recent version of Windows 10 you can try testing with "System (enhanced)" scaling. Set that on the compiled program via Properties.