That's clever to use the font as mask, so you can do any gradient in it.
In addition I don't write all the gradient datas
Copper of Amiga make this gradient with skip,move and wait command, i am using Winuae to
make screenshot without antialiasing methode and extract the picture of the raster bar or copper bar.
After that i use this code to extract copper datas.
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls,
BGRAVirtualScreen, BGRABitmap, BGRABitmapTypes ;
type
{ TForm1 }
TForm1 = class(TForm)
BGRAVirtualScreen1: TBGRAVirtualScreen;
Memo1: TMemo;
procedure BGRAVirtualScreen1Redraw(Sender: TObject; Bitmap: TBGRABitmap);
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
private
public
end;
var
Form1: TForm1;
image : TBGRABitmap;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
begin
image := TBGRABitmap.Create('rasters.png'); // 1 pixel en y ; 640 pixel en x
end;
procedure TForm1.FormShow(Sender: TObject);
var x,c : integer;
p : PBGRAPixel;
rez,final : string;
begin
c:= 0; // data array counter
rez := ''; // store raster color data
final :=''; // final result of color data
memo1.Text :=''; // clear memo1 text
for x := 0 to image.Width-1 do
begin
p := image.GetScanlineAt(x,0); // scan just x to 639+1
rez := intToHex(p^.red) + intToHex(p^.green) + intToHex(p^.blue); // extract r,g,b component ;
final := final + QuotedStr('#'+rez) +',' ;
c:= x;
end;
SetLength(final,length(final)-1); // remove last char :
memo1.Text := 'const ' + #13#10;
memo1.Text := memo1.Text + 'raster_data :Array[0..'+intToStr(c)+'] of String =(' + final + ');' ;
end;
procedure TForm1.BGRAVirtualScreen1Redraw(Sender: TObject; Bitmap: TBGRABitmap);
begin
Bitmap.Canvas2D.drawImage(image,0,0,640-1,160,rfLinear); // stretch a bit ;
end;
end.