AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

VB.NET in Delphi.NET

Ein Thema von Curse4Life · begonnen am 8. Dez 2004 · letzter Beitrag vom 8. Dez 2004
Antwort Antwort
Curse4Life

Registriert seit: 19. Jun 2004
36 Beiträge
 
#1

VB.NET in Delphi.NET

  Alt 8. Dez 2004, 22:30
Ich habe hier eine VB.NET Funktion:
Delphi-Quellcode:
Sub abrunden(ByVal was As Object, _
  ByVal x As Integer, ByVal y As Integer, _
  ByVal width As Integer, ByVal height As Integer, _
  ByVal radius As Integer)


  Dim gp As System.Drawing.Drawing2D.GraphicsPath = _
    New System.Drawing.Drawing2D.GraphicsPath()

  gp.AddLine(x + radius, y, x + width - radius, y)
  gp.AddArc(x + width - radius, y, radius, radius, 270, 90)
  gp.AddLine(x + width, y + radius, x + width, y + height - radius)
  gp.AddArc(x + width - radius, y + height - radius, radius, radius, 0, 90)
  gp.AddLine(x + width - radius, y + height, x + radius, y + height)
  gp.AddArc(x, y + height - radius, radius, radius, 90, 90)
  gp.AddLine(x, y + height - radius, x, y + radius)
  gp.AddArc(x, y, radius, radius, 180, 90)
  gp.CloseFigure()

  was.region = New System.Drawing.Region(gp)
  gp.Dispose()
End Sub

Diese habe ich soweit bisher übersetzt:
Delphi-Quellcode:
procedure abrunden(was: Form; x, y, width, height, radius: Integer);
var
  gp: System.Drawing.Drawing2D.GraphicsPath;
begin
  gp := New System.Drawing.Drawing2D.GraphicsPath(); // Hier kommt ein Fehler
  gp.AddLine(x + radius, y, x + width - radius, y);
  gp.AddArc(x + width - radius, y, radius, radius, 270, 90);
  gp.AddLine(x + width, y + radius, x + width, y + height - radius);
  gp.AddArc(x + width - radius, y + height - radius, radius, radius, 0, 90);
  gp.AddLine(x + width - radius, y + height, x + radius, y + height);
  gp.AddArc(x, y + height - radius, radius, radius, 90, 90);
  gp.AddLine(x, y + height - radius, x, y + radius);
  gp.AddArc(x, y, radius, radius, 180, 90);
  gp.CloseFigure();

  was.Region := System.Drawing.Region(gp); // Und hier kommt auch einer
  gp.Dispose();
End;

Kann mir jemand helfen?

mfg
Curse4Life
  Mit Zitat antworten Zitat
Marco Haffner
(Gast)

n/a Beiträge
 
#2

Re: VB.NET in Delphi.NET

  Alt 8. Dez 2004, 23:25
Code:
gp := System.Drawing.Drawing2D.GraphicsPath.Create;
...
was.Region := System.Drawing.Region.Create(gp);
New gibt es unter Delphi so nicht.
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 21:05 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz