怎样可以指定canvas.textout或者别的文本输出按照y轴方向啊?
解决方案 »
- 一个关于对象的创建和释放的问题(tstrings)
- bpl文件能被vb,vc等IDE共享吗?
- 怎样判断EXCEL文件是否打开?
- 找字符串问题这样做噶有必要(在数据库中找快还是TStringList快)
- 如何设置参数变量的类型为WideString???
- 如何动态创建一个ini文件?
- stringgrid中能不能换行显示文本?散分
- 窗体报错
- 我一直想知道在excel中如何删除一行,是太难还是太简单?怎么没人肯指点我呢?
- windows的系统高手们,怎么让程序在msconfig中看不出来???
- 急,如何识图片中的字母??
- Delphi6的安装程序应该怎么做?自带的Installshield好像不能导入Delphi工程文件!应该怎么做?
比如Charset:=‘GB2312_CHARSET’ 什么的,字就倒了,这样可以不?
You can rotate TrueType fonts at any angle. This is useful for labeling charts and other illustrations. The following example rotates a string in 10-degree increments around the center of the client area by changing the value of the lfEscapement and lfOrientation members of the LOGFONT structure used to create the font. RECT rc;
int angle;
HFONT hfnt, hfntPrev;
LPSTR lpszRotate = "String to be rotated.";
HRESULT hr;
size_t * pcch;
// Allocate memory for a LOGFONT structure.
PLOGFONT plf = (PLOGFONT) LocalAlloc(LPTR, sizeof(LOGFONT));
// Specify a font typeface name and weight.
hr = StringCchCopy(plf->lfFaceName, 6, "Arial");
if (FAILED(hr))
{
// TODO: write error handler
}plf->lfWeight = FW_NORMAL;
// Retrieve the client-rectangle dimensions.
GetClientRect(hwnd, &rc);
// Set the background mode to transparent for the
// text-output operation.
SetBkMode(hdc, TRANSPARENT);
// Draw the string 36 times, rotating 10 degrees
// counter-clockwise each time.
for (angle = 0; angle < 3600; angle += 100)
{
plf->lfEscapement = angle;
hfnt = CreateFontIndirect(plf);
hfntPrev = SelectObject(hdc, hfnt);
//
// The StringCchLength call is fitted to the lpszRotate string
//
hr = StringCchLength(lpszRotate, 22, pcch);
if (FAILED(hr))
{
// TODO: write error handler
}
TextOut(hdc, rc.right / 2, rc.bottom / 2,
lpszRotate, *pcch);
SelectObject(hdc, hfntPrev);
DeleteObject(hfnt);
}
// Reset the background mode to its default.
SetBkMode(hdc, OPAQUE);
// Free the memory allocated for the LOGFONT structure.
LocalFree((LOCALHANDLE) plf);
hfnt = CreateFontIndirect(plf);
hfntPrev = SelectObject(hdc, hfnt);
主要是这几行,创建一个字体方向