我为矩形形状创建了一个类,因为它是我的应用程序中的一个对象。不过,现在我希望这些角落都是圆的。在下面您可以看到,它是一个基本的类,可以用相同的属性创建任意数量的矩形。
public class customDrawable extends ShapeDrawable {
public void setCustomDrawableAttributes(ShapeDrawable shapeDrawable){
int x = 0;
int y = 0;
int width = 100;
int height = 100;
嗨
我已经使用windows API调用CreateRoundRgn和SetWindowRgn创建了一个圆角窗口,但是圆角并不像用GDI+绘制的圆角矩形那样平滑。有没有办法把窗角弄平?
procedure TPBSDashboardPanel.DefineWindowRegion;
var
WindowRegion: HRGN;
begin
if Assigned(Parent) then
begin
WindowRegion := CreateRoundRectRgn(0, 0, Width, Height, 20, 20);
SetWindowRgn(Hand
由于在GDI+中使用DrawArc函数在绘制小圆角矩形时不是很准确,所以我改用RoundRect。
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
Dim hDC As IntPtr = e.Graphics.GetHdc
Dim rc As New Rectangle(10, 10, 64, 24)
Dim hPen As IntPtr = Win32.CreatePen(Win32.PenStyle.PS_SOLID, 0, _
C