c# - How to flip a string? -
how can flip string in c#
application example : "ambulance" text seen mirror image.i dont have idea start .im using c#
forms application
i have tried reversing string ,but there possibility flip string (like mirror images)?
like : ƎƆИa⅃uᙠma
this not reversing in so post
as approach outlined sergey, can use graphics.scaletransform()
reflect y-axis.
for example, create default windows forms application , drop following onpaint()
it, run it:
protected override void onpaint(painteventargs e) { base.onpaint(e); string text = "this come out backwards"; e.graphics.scaletransform(-1, 1); float w = e.graphics.measurestring(text, this.font).width; e.graphics.drawstring(text, this.font, brushes.black, -w, 0); }
output:
you can mess around graphics.rotatetransform()
rotate text well, , use graphics.scaletransform(1, -1)
invert mirror it:
Comments
Post a Comment