added more "professional" way to "show transparency" :)

+ some bugfixes in renderMT and Fullscreen
This commit is contained in:
zueuk
2006-08-23 15:57:47 +00:00
parent 53e8c17ac2
commit 37a2bc7ad7
8 changed files with 191 additions and 153 deletions

View File

@ -23,7 +23,7 @@ interface
uses
Windows, Graphics, Classes,
Controlpoint, RenderTypes, ImageMaker;
Controlpoint, RenderTypes, ImageMaker, PngImage;
///////////////////////////////////////////////////////////////////////////////
//
@ -102,6 +102,7 @@ type
procedure Render; virtual;
function GetImage: TBitmap; virtual;
function GetTransparentImage: TPngObject;
procedure UpdateImage(CP: TControlPoint);
procedure SaveImage(const FileName: String);
@ -251,13 +252,25 @@ end;
///////////////////////////////////////////////////////////////////////////////
function TBaseRenderer.GetImage: TBitmap;
begin
if FStop <> 0 then begin
if FStop > 0 then begin
assert(false);
FImageMaker.OnProgress := OnProgress;
FImageMaker.CreateImage;
end;
Result := FImageMaker.GetImage;
end;
///////////////////////////////////////////////////////////////////////////////
function TBaseRenderer.GetTransparentImage: TPngObject;
begin
if FStop > 0 then begin
assert(false);
FImageMaker.OnProgress := OnProgress;
FImageMaker.CreateImage;
end;
Result := FImageMaker.GetTransparentImage;
end;
///////////////////////////////////////////////////////////////////////////////
procedure TBaseRenderer.UpdateImage(CP: TControlPoint);
begin
@ -278,7 +291,7 @@ end;
///////////////////////////////////////////////////////////////////////////////
procedure TBaseRenderer.SaveImage(const FileName: String);
begin
if FStop <> 0 then begin
if FStop > 0 then begin
if Assigned(strOutput) then
strOutput.Add(TimeToStr(Now) + Format(' : Creating image with quality = %f', [fcp.actual_density]));
FImageMaker.OnProgress := OnProgress;
@ -476,7 +489,7 @@ begin
SetPixels;
RenderTime := Now - RenderTime;
if FStop >= 0 then begin
if FStop <= 0 then begin
if Assigned(strOutput) then begin
if fcp.sample_density = fcp.actual_density then
strOutput.Add(TimeToStr(Now) + ' : Creating image')