我是一名有用的助手,以下是你需要翻译的内容:
我正在尝试使用DirectShow向从USB摄像头获取的位图写入文本。 问题在于文本镜像翻转并倒置,我不知道为什么。
这是编写文本的代码:
BITMAPINFOHEADER bih = m_videoInfo.bmiHeader;
Bitmap bmp(bih.biWidth, bih.biHeight, m_stride, m_pixFmt, pBuffer);
Graphics g(&bmp);
if (this->introTimer->timeToDo())
{
RectF pos(10, 10, 100, 100);
SolidBrush brush(Color::Black);
Font font(FontFamily::GenericSerif(), 30);
hr = g.DrawString(this->introText, -1, &font, pos, StringFormat::GenericDefault(), &brush);
return hr;
}
我不确定我的代码是否是影响字符串绘制的唯一因素。也许有一些配置或其他东西。
更新 我尝试使用Hans Passant建议的负高度,结果是文本根本没有被写入。