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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Copying bitmap to an object

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
bmesser Posted - Apr 25 2014 : 05:25:51
Hi

I'm trying to grab the canvas of a GridPanel component which contains a couple of graphs (in two panels) and add them as an object of the same size to a TImageENVect component. I've got it to work, but the image I grab is not as good as the original. Am I missing something with this code or maybe there is a better way to do this?

Bruce.

var
  bmp   : TBitMap;
  obj   : integer;
begin
  bmp:=TBitmap.Create;

  try
    bmp.Width:=GridPanel1.Width;
    bmp.Height:=GridPanel1.Height;
    bmp.PixelFormat:=pf32bit;

    bmp.Canvas.CopyRect(Rect(0,0,bmp.Width,bmp.Height),Canvas,Rect(GridPanel1.Left,GridPanel1.Top,GridPanel1.Left+GridPanel1.Width,GridPanel1.Top+GridPanel1.Height));
    obj:=Image.AddNewObject;
    Image.ObjKind[obj]:=iekBITMAP;
    Image.ObjSetTBitmap(obj,bmp);
    Image.SetObjRect(obj,Rect(30,30,GridPanel1.Width,GridPanel1.Height),True);
  finally
    bmp.Free
  end;
1   L A T E S T    R E P L I E S    (Newest First)
bmesser Posted - Apr 25 2014 : 08:18:04
I eventually found the property BitmapResampleFilter which has fixed the problem!