我目前正試圖添加鏡像到我們的RotateBitmap例程(從http://www.efg2.com/Lab/ImageProcessing/RotateScanline.htm)。這目前看起來是這樣的(BitMapRotated是TBitmap)的僞代碼:如何「刷新」更改位圖的ScanLine
var
RowRotatedQ: pRGBquadArray; //4 bytes
if must reflect then
begin
for each j do
begin
RowRotatedQ := BitmapRotated.Scanline[j];
manipulate RowRotatedQ
end;
end;
if must rotate then
begin
BitmapRotated.SetSize(NewWidth, NewHeight); //resize it for rotation
...
end;
這個作品,如果我要麼必須旋轉或反映。如果我這樣做,那麼顯然SetSize
的呼叫會使我之前通過ScanLine所做的更改無效。我如何「沖洗」或保存我的更改?我嘗試撥打BitmapRotated.Handle
,BitmapRotated.Dormant
和設置BitmapRotated.Canvas.Pixels[0, 0]
,但沒有運氣。
編輯:我找到了真正的問題 - 我重寫我的變化從原始位值。對此感到抱歉。
爲什麼不使用現成的庫像Graphics32.org或吸血鬼的影像? –
我只是有一個輸出位圖。無論如何,['這個Q&A'](http://stackoverflow.com/a/10633410/960757)可能對你的任務很有意思。 – TLama
@ Arioch'The:我們已經在使用這個例程,它似乎是一個簡單的任務來擴展它。 –