DELPHI AREA
MESSAGE BOARD
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   FavoritesFavorites   Watched TopicsWatched Topics     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TSimpleGraph or TPrintPreview bug ?
Goto page Previous  1, 2
 
Post new topic   Reply to topic   printer-friendly view    DELPHI AREA Forum Index -> DELPHI AREA's Products
View previous topic :: View next topic  
Author Message
P_G
Member


Joined: 14 Jun 2004
Posts: 44
Location: Germany

PostPosted: 06/06/05 14:08    Post subject: Reply with quote

Hi Kambiz,

For testing I deleted the SelectClipRgn line:

Code:
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
Back to top
View user's profile Send private message
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 1044
Location: Tehran, Iran

PostPosted: 06/06/05 20:19    Post subject: Reply with quote

Asign a background image to a non-rectangular node to see what happens. Wink
_________________
Kambiz
Back to top
View user's profile Send private message Send e-mail Visit poster's website
P_G
Member


Joined: 14 Jun 2004
Posts: 44
Location: Germany

PostPosted: 07/06/05 09:02    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    DELPHI AREA Forum Index -> DELPHI AREA's Products All times are GMT
Goto page Previous  1, 2
Page 2 of 2

Add to favorites

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group