Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 11/15/20 in Posts

  1. In case someone wants to use the LibPhonenumber library from Google in Delphi. I've written a wrapper for the C # port of this library. Support for 32 bit and 64 bit. https://github.com/landrix/LibPhonenumber-for-Delphi
  2. So did I when I ignored him for the extensive AD for his own product. 😄 For me it's a fake Delphi group.
  3. I am not sure many know that since the Windows Creators update, svg parsing and painting is natively supported and is part of Direct2D. I wanted to test this Windows feature, however, the first obstacle was that the Direct2d headers that come with Delphi are very very old. There are two open tickets in https://quality.embarcadero.com/. Direct2D 1.1 support missing (open since XE7!) Direct2D 1.2 and 1.3 support missing You may want to vote for them, since lack of good Direct2D support (includes DirectWrite) it is a bit of a shame. I then looked at other Direct2D translations and found two that are regularly updated. MfPack DelphiDX12 They both had some issues but that was a good start. It turned out that parsing and painting svg files to Canvas is quite straightforward. Once you establish a renderer (Vcl.Direct2d does this, but it is easy to do it from scratch) you can do everything with two lines of code. fDeviceContext5.CreateSvgDocument(fStream, D2D1SizeF(ClientWidth, ClientHeight), fsvgDocument); fDeviceContext5.DrawSvgDocument(fsvgDocument); You can check whether Svg is supported by: if Supports( rt, ID2D1DeviceContext5, fDeviceContext5) then And it is easy to do things like scaling, opacity, rotation, recoloring etc. The quality and speed appear to be quite good, but there are some limitations, the most important of which I think is the lack of support for the text element. I am attaching the source code of my test project (no dependencies) in case anyone wants to play with it. The Svg scales automatically as you resize the form. Svg.zip
  4. Funny. I got booted too for suggesting he should stop posting about his non-delphi related pet projects. I guess that group wasn't big enough for both our egos Can't say I miss it much.
  5. Thanks! Maybe I angered the moderator....called him a Visual Basic programmer or something.
  6. @Darian Miller, it's a private group with 10.3K members. Tried to invite you but got the "There was an issue sending your invite. Please try again." error, no idea what's happening. However, I've reported the issue to the moderator.
  7. There are a few issues with your code and a few things that could be improved. 1) A member function has a hidden "self" parameter so in reality the signature of the MakeSine function you have declared looks like this: function MakeSine(const [ref] Self: TRadio; handle: HSTREAM; buffer: Pointer; Alength: DWORD; user: Pointer): DWORD; stdcall; If you want MakeSine declared as a member function then you need to declare it as a static class method: type TRadio = record ... class function MakeSine(handle: HSTREAM; buffer: Pointer; Alength: DWORD; user: Pointer): DWORD; stdcall; static; end; but then you lose the reference to self and can't access the member variables inside the method. I'm guessing that the user parameter is for passing context to the callback and if so you can achieve the same with an extra function: type TRadio = record ... private function DoMakeSine(handle: HSTREAM; buffer: Pointer; Alength: DWORD): DWORD; public class function MakeSine(handle: HSTREAM; buffer: Pointer; Alength: DWORD; user: Pointer): DWORD; stdcall; static; end; class function TRadio.MakeSine(handle: HSTREAM; buffer: Pointer; Alength: DWORD; user: Pointer): DWORD; begin Result := TRadioPointer(user).DoMakeSine(handle, buffer, Alength); end; function TRadio.DoMakeSine(handle: HSTREAM; buffer: Pointer; Alength: DWORD): DWORD; begin ... end; begin // Pass TRadio pointer as the "user" parameter resultValue := BASS_StreamCreate(cSAMPLE_RATE, 2, 0, @TRadio.MakeSine, PRadio); end 2) The convention would be to name your TRadio pointer type "PRadio" type TRadio = record ... end; PRadio = ^TRadio; 3) You don't need to deference typed complex pointer types with ^ PRadio^.MakeSine // standard Pascal PRadio.MakeSine // allowed in Delphi
  8. This usually hapend when a function has a var argument and you try to pass a property. Copy the property to a temporary variable, pass the variable as argument to the function, set the property with the [potentially new] temporary variable.
  9. Dave Nottage

    StoryBoard launch screen - Delphi 10.4

    It's not, e.g: https://stackoverflow.com/questions/33002829/ios-keeping-old-launch-screen-and-app-icon-after-update Another possible solution (which I have not tried): http://arsenkin.com/launch_screen_image_cache.html Edit: An afterthought - this might not help you since your problem is no splash screen at all. Having said that, I still expect it is not an Embarcadero issue.
×