Jump to content

dwrbudr

Members
  • Content Count

    81
  • Joined

  • Last visited

Everything posted by dwrbudr

  1. dwrbudr

    Skia4Delphi

    The skottie player demo using check.json doesn't correctly draw the image. See the black rugged edge border when the circle is being painted. Instead of using TWICBitmap, I've switched to 32bit TBitmap and created the TSKSurface like this: LSurface := TSKSurface.MakeRasterDirect(TSKImageInfo.Create( fBitmap.Width, fBitmap.Height, TSKColorType.BGRA8888), fBitmap.ScanLine[fBitmap.Height - 1], BytesPerScanLine(fBitmap.Width, 32, 32)); LSurface.Canvas.Clear(TAlphaColors.Null); FAnimation.Render(LSurface.Canvas, fDestRect); //flip the image since the DIB is bottom-up orientaded StretchBlt(fBitmap.Canvas.Handle, 0, 0, fBitmap.Width, fBitmap.Height, fBitmap.Canvas.Handle, 0, fBitmap.Height - 1, fBitmap.Width, -fBitmap.Height, SRCCOPY); Now all seem OK and the border is not rugged, not sure whtat's wrong with TWICBitmap. Check the border of the images below.
  2. dwrbudr

    Looking for SVG support in Delphi?

    I could provide resvg bindings if you like and a compiled DLL files (32 and 64bit)
  3. dwrbudr

    Skia4Delphi

    I've tried to convert SVG to PNG with this library without luck. What's wrong with this code? The SVG file is in the EXE folder as well as sk4d.dll On other pretty simple SVG files, LDOM is nil, probably TSKSVGDOM is too strict. var LDOM: ISKSVGDOM; LSize: TSizeF; LSVGStream: ISKStream; LSurface: ISKSurface; LImage: ISKImage; begin LSurface := TSKSurface.MakeRaster(256, 256); LSVGStream := TSKFileStream.Create(ExtractFilePath(Application.ExeName) + 'porsche.svg'); LDOM := TSKSVGDOM.Make(LSVGStream); (LDOM as TSkiaObject).DebugMessageProc := procedure(const AMessage: string) begin Caption := AMessage; end; LSize := LDOM.Root.GetIntrinsicSize(TSizeF.Create(0, 0)); // <== LSize is (0, 0) ?! LDOM.Render(LSurface.Canvas); // DebugMessageProc called with "can''t render image: load image failed" LImage := LSurface.MakeImageSnapshot; LImage.EncodeToFile(ExtractFilePath(Application.ExeName) + 'output.png', TSKEncodedImageFormat.PNG); end;
  4. dwrbudr

    Skia4Delphi

    Could you please add the source of the Skia Demo to the repository?
  5. dwrbudr

    Drawing bug with VCL Styles

    I can reproduce the issue. The main thing here is that the monitors should not be aligned. The bug is already reported, but nobody seems to care: https://quality.embarcadero.com/browse/RSP-27207
×