How can I render curved text into a Bitmap?

前端 未结 3 557
无人及你
无人及你 2020-12-05 22:01

I am currently dynamically creating a bitmap and using the graphics object from the bitmap to draw a string on it like so:

System.Drawing.Graphics graph = Sy         


        
3条回答
  •  误落风尘
    2020-12-05 22:28

    Unfortunatelly in GDI+ there is no way to attach Strings to a path (this is what you would be looking for).

    So the only way to do this is doing it "by hand". That means splitting up the string into characters and placing them based on your own path calculations.

    Unless you want to put a lot of work into this you should try to find a library (potentially complete GDI+ replacement) to do this or give up on your rainbow.

    With WPF you can render text on a path (see link for a howto)

提交回复
热议问题