Thanks Roland and WP.
WP, The png I was using had alpha. You were correct TBitmapPixel = record B, G, R, A: UInt8 end; solved it.
Also Thanks for the conversion of GeoPattern. Was so happy playing with it.
Roland, got and error at if ImageSource.HasGraphic then , but found a slightly different version of your gray scaler so I replaced:
procedure TForm1.Scale;
begin
if ImageSource.HasGraphic then
ImageScaled.Picture.Assign(ImageSource.Picture)
else
Exit;
if (ImageScaled.Picture.Width / ImageScaled.Picture.Height) > (Panel1.Width / Panel1.Height) then
BitmapScale(ImageScaled.Picture.Bitmap, Panel1.Width, 0)
else
BitmapScale(ImageScaled.Picture.Bitmap, 0, Panel1.Height);
end;
with
procedure TForm1.Scale;
begin
ImageScaled.Picture.Assign(ImageSource.Picture);
if (ImageSource.Picture.Width > Panel1.Width) or (ImageSource.Picture.Height > Panel1.Height) then
if (ImageScaled.Picture.Width / ImageScaled.Picture.Height) > (Panel1.Width / Panel1.Height) then
BitmapScale(ImageScaled.Picture.Bitmap, Panel1.Width, 0)
else
BitmapScale(ImageScaled.Picture.Bitmap, 0, Panel1.Height);
end;
Many thanks Roland for that.
Also thanks for the Vector version of Spiral of Theodorus. Much appreciated.