Here's a quick question that I hope that can be solved quickly.
How would I write black text on a Canvas? My current code looks like this.
Simba Code:
program new;
var
Buffer: Integer;
procedure DrawOnBuffer;
var
text, Width, Height: Integer;
Font: TFont;
begin
Buffer:= BitmapFromString(200, 200, '');
RectangleBitmap(Buffer, IntToBox(0, 0, 199, 199), 16777215); //Comment this line
//and you will see text
Font := TFont.Create;
Font.Name := 'Courier New';
Font.Size := 10;
Font.Color:= 0;
Font.Style := [];
LoadSystemFont(Font,'test');
text:= BitmapFromText('Hello', 'test');
GetBitmapSize(text, Width, Height);
SetTransparentcolor (text, clBlack);
FastDrawTransparent(round ((200 * 0.5) - (Width/ 2)), 12, text, Buffer);
FreeBitmap(text);
Font.free;
end;
procedure CreateCanvas;
begin
DisplayDebugImgWindow(200, 200);
DrawOnBuffer;
DrawBitmapDebugImg(Buffer);
FreeBitmap(Buffer);
end;
begin
SetupSRL;
CreateCanvas;
end.
Is there anyway where I can turn the font color black? Also...
Out of curiousity, is there a way to create transparent colors for TImages (bitmaps) that are on a form?