Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 11/20/22 in all areas

  1. David_Lyon

    ANN: Skia4Delphi 4.0.1 compilation error

    @vfbb Thank you for your reply. I think something in my code does not agree with Skia4Delphi, but after having no problem with new projects using Skia4Delphi, I'll have to investigate more. I've been doing quite a few tricky things with my UI, so I'll simplify my code and try again. Hopefully, I'll be able to rebuild on more solid ground. Thanks for your help.
  2. Solid answer to those who say Delphi is dying - see how Delphi is killing 😄
  3. Pat Foley

    Install rotating component in RAD 10.4

    Ok FMX has TControls where in VCL windows has TgraphicControls no windows handle and TWinControls. In short FMX controls don't work in VCL. To show palette on menu right click on menu and select components. To install a control into the VCL Palette be in 32 bit mode the IDE is 32 bit and needs any component to be 32 bit and to be made into a DCP so that control can used in the IDE. It's easy to stick the IDE if control is not well tested. You could load one control into the dslusr.bpl to get a feel for operation. Under component install existing and select dslusr.bpl. Save the projectgroup somewhere. Here's some code to try until you get that package loaded. procedure RotateBitmapRads(Bmp: TBitmap; Rads: Single; AdjustSize: Boolean; BkColor: TColor = clNone); var C: Single; S: Single; Tmp: TBitmap; OffsetX: Single; OffsetY: Single; Points: array[0..2] of TPoint; begin C := Cos(Rads); S := Sin(Rads); Tmp := TBitmap.Create; try Tmp.TransparentColor := Bmp.TransparentColor; Tmp.TransparentMode := Bmp.TransparentMode; Tmp.Transparent := Bmp.Transparent; Tmp.Canvas.Brush.Color := BkColor; if AdjustSize then begin Tmp.Width := Round(Bmp.Width * Abs(C) + Bmp.Height * Abs(S)); Tmp.Height := Round(Bmp.Width * Abs(S) + Bmp.Height * Abs(C)); OffsetX := (Tmp.Width - Bmp.Width * C + Bmp.Height * S) / 2; OffsetY := (Tmp.Height - Bmp.Width * S - Bmp.Height * C) / 2; end else begin Tmp.Width := Bmp.Width; Tmp.Height := Bmp.Height; OffsetX := (Bmp.Width - Bmp.Width * C + Bmp.Height * S) / 2; OffsetY := (Bmp.Height - Bmp.Width * S - Bmp.Height * C) / 2; end; Points[0].X := Round(OffsetX); Points[0].Y := Round(OffsetY); Points[1].X := Round(OffsetX + Bmp.Width * C); Points[1].Y := Round(OffsetY + Bmp.Width * S); Points[2].X := Round(OffsetX - Bmp.Height * S); Points[2].Y := Round(OffsetY + Bmp.Height * C); PlgBlt(Tmp.Canvas.Handle, Points, Bmp.Canvas.Handle, 0, 0, Bmp.Width, Bmp.Height, 0, 0, 0); Bmp.Assign(Tmp); finally Tmp.Free; end; end; procedure TForm20.Button1Click(Sender: TObject); begin RotateBitmapRads(image1.Picture.Bitmap,2/57,true, Self.Color); end;
×