ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Different colors for background and clientrect
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

BionicWave

Germany
33 Posts

Posted - Mar 08 2012 :  06:31:01  Show Profile  Reply
Is it possible to set different back-colors for the image- and the clientrect-background of an ImageEnview?
I would like to be able to distinguish where the actual image begins and where the background of the ImageEnView is.

fab

1310 Posts

Posted - Mar 08 2012 :  07:38:35  Show Profile  Reply
The background style and color is unique.
However you could handle OnDrawBackground event to customize it, for example:
procedure TForm1.ImageEnView1DrawBackground(Sender: TObject; ACanvas: TCanvas; ARect: TRect; var Handled: Boolean);
begin
  Handled := true;

  // the whole background is green
  ACanvas.Brush.Color := clGreen;
  ACanvas.FillRect(ARect);

  // the image background is yellow
  ACanvas.Brush.Color := clYellow;
  with ImageEnView1 do
    ACanvas.FillRect(Rect(OffsetX, OffsetY, OffsetX + ExtentX, OffsetY + ExtentY));
end;
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: