TSimpleGraph or TPrintPreview bug ?

Please post bug reports, feature requests, or any question regarding the DELPHI AREA projects here.

Postby P_G » June 6th, 2005, 2:08 pm

Hi Kambiz,

For testing I deleted the SelectClipRgn line:

Code: Select all
procedure TGraphNode.DrawBackground(Canvas: TCanvas);
var
  ClipRgn: HRGN;
  Bitmap: TBitmap;
  Graphic: TGraphic;
begin
  if Background.Graphic <> nil then
  begin
    ClipRgn := CreateClipRgn(Canvas);
    try
    //  SelectClipRgn(Canvas.Handle, ClipRgn);
      try
        Graphic := Background.Graphic;
        Background.OnChange := nil;
        Canvas.StretchDraw(BoundsRect, Graphic);
        Background.OnChange := BackgroundChanged;
      finally
        SelectClipRgn(Canvas.Handle, 0);
      end;
    finally
      DeleteObject(ClipRgn);
    end;
    Canvas.Brush.Style := bsClear;
  end;
end;


Now it seems to work, however I asked myself which problems could occur by doing this, even though I didn't noticed any so far.

P_G
P_G
Senior Member
Senior Member
 
Posts: 51
Joined: June 14th, 2004, 11:13 am
Location: Germany

Postby Kambiz » June 6th, 2005, 8:19 pm

Asign a background image to a non-rectangular node to see what happens. :wink:
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby P_G » June 7th, 2005, 9:02 am

This is the only problem? As a matter of fact in most cases I don't need other nodes than rectangular ones. So a good workaround for me could be something like: If all conditions for this bug are met, don't convert the metafile to a bitmap, but skip the clipping. If this is combined with a boolean variable (so the user can choose between bitmap conversion or clipping to workaround) everything would be absolutely perfect.

Yours, P_G
P_G
Senior Member
Senior Member
 
Posts: 51
Joined: June 14th, 2004, 11:13 am
Location: Germany

Previous

Return to DELPHI AREA Projects

Who is online

Users browsing this forum: No registered users and 2 guests

cron