不规则形状 [英] Irregularly shaped forms
本文介绍了不规则形状的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
是可以的,你必须使用(使用位图图像)
Many modern applications have irregularly shaped forms. What is the best way to do this in Delphi? Is it possible to do this without using any third party VCLs?
解决方案
yes is possible, you must use the SetWindowRgn function to set the new window region to draw.
try this code
procedure TForm1.FormCreate(Sender: TObject);
var
region:HRGN;
begin
region := CreateRoundRectRgn(ClientRect.left, ClientRect.top, ClientRect.right, ClientRect.bottom, 15, 15);
SetWindowRgn(Handle, region, true);
end;
check theses links for more info
- Creating Shaped Forms (using a bitmap image)
- Is it possible to create forms with shapes other than the standard rectangular shape in Windows? (using an poligon)
这篇关于不规则形状的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文