Цитата:
Сообщение от GriLab
А так не сойдет? Должно работать:
Код:
Image1.Canvas.Pixels[10, 10]
|
нет, не должно:
TImage = class(TGraphicControl)
public
property Canvas: TCanvas read GetCanvas;
function TImage.GetCanvas: TCanvas;
var
Bitmap: TBitmap;
begin
if Picture.Graphic = nil then
begin
Bitmap := TBitmap.Create;
try
Bitmap.Width := Width;
Bitmap.Height := Height;
Picture.Graphic := Bitmap;
finally
Bitmap.Free;
end;
end;
if Picture.Graphic is TBitmap then
Result := TBitmap(Picture.Graphic).Canvas
else
raise EInvalidOperation.Create(SImageCanvasNeedsBitmap);
end;
вот поэтому "Can only modify an image if it contains a bitmap" и получим для jpeg