如何在CMFCHeaderCtrl中更改箭头的大小? [英] How change size of arrows in CMFCHeaderCtrl?
本文介绍了如何在CMFCHeaderCtrl中更改箭头的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨!
我这个代码加载图标:
Hi!
I load icon by this code:
void Test::OnDrawSortArrow(CDC* pDC, CRect rectArrow)
{
Metafile * emf = NULL;
emf = LoadMetafile(IDR_ICON_EXPAND, NULL, true);
Gdiplus::Bitmap* image = BitmapFromEmf(emf, 8, 8, Color(255,82,82,82), 0);
HICON hIcon = NULL;
if(IsAscending())
image->RotateFlip(Rotate180FlipNone);
image->GetHICON(&hIcon);
pDC->DrawIcon(rectArrow.TopLeft().x - 20, rectArrow.TopLeft().y - 10, hIcon);
delete emf;
}
我加载的图标应该是8x8但这个图标拉伸到更大尺寸的问题
如何将箭头大小设置为8?
The problem that icon that I loaded should be 8x8 but this icon stretching to more bigger size
How can I set size of arrows to 8?
推荐答案
这有什么用? http://cboard.cprogramming.com/windows-programming/69137-listview- arrow-column-head.html [ ^ ]
This any use? http://cboard.cprogramming.com/windows-programming/69137-listview-arrow-column-head.html[^]
我找到了解决方案!
需要更改图像边距
I found solution!
Need to change margin of image
void Test::OnDrawSortArrow(CDC* pDC, CRect rectArrow)
{
Metafile * emf = NULL;
emf = LoadMetafile(IDR_ICON_EXPAND, NULL, true);
Gdiplus::Bitmap* image = BitmapFromEmf(emf, 8, 8, Color(255,82,82,82), 0);
HICON hIcon = NULL;
pDC->DrawIcon(rectArrow.TopLeft().x - 20, rectArrow.TopLeft().y - 10, hIcon);
delete emf;
}
这篇关于如何在CMFCHeaderCtrl中更改箭头的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文