Hi Guys,
Thanks for your replies, much appreciated. I am trying to keep with BGRABITMAP as using this for other stuff, the ImageMagick does look interesting; I will have a look at that later.
Its nearly 4:00am and after a strong coffee, I had another look at code and it now looks like this and works fine.
modified code
var
DestinationRect: TRect;
bmpBGRA: TBGRACustomBitmap;
begin
if ((FCurValue>=0) and (FCurValue<images.Count)) then FImages.GetBitmap(FCurValue,FForeImage)
else if FCurValue<0 then FImages.GetBitmap(0,FForeImage)
else FImages.GetBitmap(Fimages.Count-1,FForeImage);
DestinationRect := Rect(0,0, self.width, self.Height);
canvas.CopyMode := cmSrcCopy;
bmpBGRA:=TBGRABitmap.create(FForeImage);
bmpBGRA.ResampleFilter := rfMitchell;
bmpBGRA.ResampleFilter:=rfBestQuality;
bmpBGRA := bmpBGRA.Resample(self.Width, self.Height, rmFineResample) as TBGRABitmap;
bmpBGRA.Draw(Canvas,0,0,false); // Must use false for transparency
with FForeImage do
begin
Clear;
SetSize(self.Width,self.Height);
Canvas.Draw(0,0,bmpBGRA.Bitmap);
end;
canvas.CopyRect(DestinationRect, FForeImage.Canvas, DestinationRect);
bmpBgra.Free;
end;
It's probably not the neatest; and could do with some tidying; but for now it works; and will tidy up later...
Thanks Again
Josh