AGB  ·  Datenschutz  ·  Impressum  







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

Direct2D Anwendung

Ein Thema von BRobby · begonnen am 6. Jun 2025 · letzter Beitrag vom 9. Jun 2025
Antwort Antwort
BRobby

Registriert seit: 30. Dez 2004
Ort: Bottrop
34 Beiträge
 
Delphi 12 Athens
 
#1

Direct2D Anwendung

  Alt 6. Jun 2025, 17:21
Hallo zusammen,

ich experimentiere mit Direct2D und in diesem Zusammenhang fehlen mir die Units Winapi.DWrite.pas und Winapi.DWrite1.pas, um auch Text ausgeben zu können.
Die sind in der Community Edition leider nicht vorhanden.

Kann mir jeman vielleicht diese beiden Routinen zur Verfügung stellen?

Vielen Dank!
  Mit Zitat antworten Zitat
Benutzerbild von Uwe Raabe
Uwe Raabe

Registriert seit: 20. Jan 2006
Ort: Lübbecke
11.702 Beiträge
 
Delphi 12 Athens
 
#2

AW: Direct2D Anwendung

  Alt 6. Jun 2025, 17:38
Die Units sind auch in den höheren Editionen nicht dabei. Woraus schließt du denn, dass du diese Units brauchst?
Uwe Raabe
Certified Delphi Master Developer
Embarcadero MVP
Blog: The Art of Delphi Programming
  Mit Zitat antworten Zitat
BRobby

Registriert seit: 30. Dez 2004
Ort: Bottrop
34 Beiträge
 
Delphi 12 Athens
 
#3

AW: Direct2D Anwendung

  Alt 6. Jun 2025, 17:50
Ich möchte konkret an einem Beispiel in alle in einer Schleife gezeichneten Rechtecke eine Nummer als Text eintragen.
Das geht zwischen BeginDraw und EndDraw nur mit Direct2D-Befehlen, normale GDI-Ausgabe würde nach EndDraw überschrieben.
Diese Befehle für Textausgabe sind, wie ich mittels künstlicher Intelligenz ermittelt habe, nur in den genannten Units vorhanden.
  Mit Zitat antworten Zitat
TSchnuckenbock

Registriert seit: 20. Jul 2017
Ort: Lüneburger Heide
76 Beiträge
 
Delphi XE5 Professional
 
#4

AW: Direct2D Anwendung

  Alt 6. Jun 2025, 18:13
Ich habe mal die künstliche Intelligenz gefragt, wo ich die gesuchte Datei finde.
Die KI schrieb u.a. was von einem "MfPack" bei SourgeForge, über das ich dann das Projekt bei Github fand:

https://github.com/FactoryXCode/MfPack

Eventuell hat sich der Dateiname etwas geändert. Schau mal unter dem folgenden Link, ob es die gesuchte Datei ist:

https://github.com/FactoryXCode/MfPa...ctX.DWrite.pas

Alles ohne Gewähr!
  Mit Zitat antworten Zitat
BRobby

Registriert seit: 30. Dez 2004
Ort: Bottrop
34 Beiträge
 
Delphi 12 Athens
 
#5

AW: Direct2D Anwendung

  Alt 7. Jun 2025, 15:02
Vielen Dank für den Hinweis.
Indem angegebenen Bereich finden sich tatsächlich die gesuchten Dateien, aber in anderem Kontext.
Das Zusammenspiel funktioniert leider noch nicht wie erwartet.
  Mit Zitat antworten Zitat
Kas Ob.

Registriert seit: 3. Sep 2023
439 Beiträge
 
#6

AW: Direct2D Anwendung

  Alt 7. Jun 2025, 17:36
Vielen Dank für den Hinweis.
Indem angegebenen Bereich finden sich tatsächlich die gesuchten Dateien, aber in anderem Kontext.
Das Zusammenspiel funktioniert leider noch nicht wie erwartet.
I didn't test https://github.com/FactoryXCode/MfPack but it is the most complete implementation i saw, BUT

Be careful it is full of miss ordered functions with overload , it may be all of them are wrong in every file in that translation.

here two examples
1) IDWriteFontSet1 https://learn.microsoft.com/en-us/wi...dwritefontset1 the order of the functions is
Code:
....
IDWriteFontSet1::GetFilteredFonts
Retrieves a subset of fonts filtered by the given ranges, endpoint-inclusive.

IDWriteFontSet1::GetFilteredFonts
Retrieves a subset of fonts filtered by the given properties.

IDWriteFontSet1::GetFilteredFonts
Retrieves a subset of fonts, filtered by the given indices.
....
but in the translation from https://github.com/FactoryXCode/MfPa...as#L2582-L2614 is
Delphi-Quellcode:
    function GetFilteredFonts(properties: PDWRITE_FONT_PROPERTY;
                              propertyCount: UINT32;
                              selectAnyProperty: BOOL;
                              out filteredFontSet: IDWriteFontSet1): HResult; overload; stdcall;

    function GetFilteredFonts(fontAxisRanges: DWRITE_FONT_AXIS_RANGE;
                              fontAxisRangeCount: UINT32;
                              selectAnyRange: BOOL;
                              out filteredFontSet: IDWriteFontSet1): HResult; overload; stdcall;

    function GetFilteredFonts(indices: UINT32;
                              indexCount: UINT32;
                              out filteredFontSet: IDWriteFontSet1): HResult; overload; stdcall;
the three overloads are miss placed and they should be like this , the order should be
Delphi-Quellcode:
    function GetFilteredFonts(indices: UINT32;
                              indexCount: UINT32;
                              out filteredFontSet: IDWriteFontSet1): HResult; overload; stdcall;

    function GetFilteredFonts(properties: PDWRITE_FONT_PROPERTY;
                              propertyCount: UINT32;
                              selectAnyProperty: BOOL;
                              out filteredFontSet: IDWriteFontSet1): HResult; overload; stdcall;

    function GetFilteredFonts(fontAxisRanges: DWRITE_FONT_AXIS_RANGE;
                              fontAxisRangeCount: UINT32;
                              selectAnyRange: BOOL;
                              out filteredFontSet: IDWriteFontSet1): HResult; overload; stdcall;
2) IDWriteGdiInterop1 from https://learn.microsoft.com/en-us/wi...itegdiinterop1 the methods are these
Code:
IDWriteGdiInterop1::CreateFontFromLOGFONT
Creates a font object that matches the properties specified by the LOGFONT structure. (IDWriteGdiInterop1.CreateFontFromLOGFONT)

IDWriteGdiInterop1::GetFontSignature
Reads the font signature from the given font. (overload 2/2)

IDWriteGdiInterop1::GetFontSignature
Reads the font signature from the given font. (overload 1/2)

IDWriteGdiInterop1::GetMatchingFontsByLOGFONT
Gets a list of matching fonts based on the specified LOGFONT values. Only fonts of that family name will be returned.
The translation from https://github.com/FactoryXCode/MfPa...#L1439C3-L1485
Delphi-Quellcode:
  IDWriteGdiInterop1 = interface(IDWriteGdiInterop)
  ['{4556BE70-3ABD-4F70-90BE-421780A6F515}']
    function CreateFontFromLOGFONT(_logFont: LOGFONT;
                                   fontCollection: IDWriteFontCollection;
                                   out font: IDWriteFont): HResult; stdcall;
    function GetFontSignature(font: IDWriteFont;
                              out _fontSignature: FONTSIGNATURE): HResult; overload; stdcall;
    function GetFontSignature(fontFace: IDWriteFontFace;
                              out fontSignature: FONTSIGNATURE): HResult; overload; stdcall;
    function GetMatchingFontsByLOGFONT(_logFont: LOGFONT;
                                       fontSet: IDWriteFontSet;
                                       out filteredSet: IDWriteFontSet): HResult; stdcall;
  end;
Also wrong and should be
Delphi-Quellcode:
  IDWriteGdiInterop1 = interface(IDWriteGdiInterop)
  ['{4556BE70-3ABD-4F70-90BE-421780A6F515}']
    function CreateFontFromLOGFONT(_logFont: LOGFONT;
                                   fontCollection: IDWriteFontCollection;
                                   out font: IDWriteFont): HResult; stdcall;
    function GetFontSignature(fontFace: IDWriteFontFace;
                              out fontSignature: FONTSIGNATURE): HResult; overload; stdcall;
    function GetFontSignature(font: IDWriteFont;
                              out _fontSignature: FONTSIGNATURE): HResult; overload; stdcall;
    function GetMatchingFontsByLOGFONT(_logFont: LOGFONT;
                                       fontSet: IDWriteFontSet;
                                       out filteredSet: IDWriteFontSet): HResult; stdcall;
  end;
this was only two examples but i think may be every overload is wrong in that library.

How to do it right ?
lets assume A,B,C,D,E,O? are interface methods, only O1,O2,O3 are overloaded methods for O, they have the same name with different parameters
let say we have an interface declared like this in an interface from Windows SDK for C++
Code:
A
O1
B
O2
C
O3
O4
O5
D
the right translation in Pascal/Delphi should be like this
Code:
A
O5
O4
O3
O2
O1
B
C
D
I pretty sure about the above problem with overloaded functions ordering and how VisualStudio missed this for long time as they can't fix it or change it, if someone can prove me wrong, then please i would to see the correct ordering.
Kas
  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 17:18 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz