gpt4 book ai didi

c# - 在图像上绘制对比字符串

转载 作者:行者123 更新时间:2023-11-30 13:43:01 24 4
gpt4 key购买 nike

所以,我有一个视频源的快照,我将其放入一个 Image 中,为其抓取一个 Graphics 对象,然后在图像的右下角绘制一个时间戳。到目前为止没问题。但是,我无法保证文本后面的颜色是什么,所以无论我使用什么画笔,它几乎肯定会与绘制的某些图像发生冲突,从而使文本无法阅读。

我想知道是否有人知道一种方法(.net 中的方法或不错的算法)来根据字符串背后的图像确定字符串的最佳颜色。

干杯

最佳答案

 just draw the string 5 times.
One time 1(or2) pixels to the left in black
One time 1(or2) pixels to the right in black
One time 1(or2) pixels above it in black
One time 1(or2) pixels below it in black
and the final time in white on the place where you want it

关于c# - 在图像上绘制对比字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1192543/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com