Could you try this ->
procedure TForm1.Button1Click(Sender: TObject);
var
bmpTmp: TBitmap;
bmpBGRA: TBGRACustomBitmap;
begin
bmpTmp:=TBitmap.create;
try
//first lets create our memory bitmap
with BmpTmp do begin
pixelformat:=pf24bit;
SetSize(100,50);
with Canvas do begin
Brush.Color:=clskyblue;
FillRect(bmpTmp.Canvas.ClipRect);
TextOut(30,20,'HELLO!');
end;
end;
//lets use BGRABitmap to do some magic
bmpBGRA:=TBGRABitmap.create(bmpTmp);
try
bmpBGRA.Canvas.Draw(0,0,bmpTmp);
//make sure we use BGRAReplace to avoid memory leak
BGRAReplace(TBgraBitmap(bmpBGRA),bmpBGRA.RotateCW);
//not lets draw our new BGRABitmap into a TBitmap that we can use with TImage
with bmpTmp do
begin
Clear; //do this to avoid Bitmap going strange on resize, possible bug!!
SetSize(bmpBGRA.Width,bmpBGRA.height);
Canvas.Draw(0,0,bmpBGRA.Bitmap);
end;
//now assign it to TImage
image1.picture.graphic := bmpTmp;
finally
bmpBGRA.free;
end;
finally
bmpTmp.free;
end;
end;