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
 CopyObjectsToBack: CopyText of a ruler is not copi

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
Marius Posted - Mar 27 2014 : 02:36:45
I'm trying to get the annotation layer (objects and text) into the clipboard, however the text of a ruler is not copied into the picture.

Or is there something wrong with this code? (the ImagePreview is an onscreen TImageEnVect where i have just placed arrows, textboxes and rulers). I'm using the latest and greates ImageEn 5.06 + delphi XE..

begin
  AToolbox := TImageEnVect.Create(nil);
  try
    AToolbox.Assign(ImagePreview);
    AToolbox.MUnit := Image.Units;
    AToolbox.SetScaleFromPixels(Image.Pixels, Image.Distance);
    ImagePreview.CopyAllObjectsTo(AToolBox);
    AToolbox.CopyObjectsToBack;
    ClipBoard.Assign(AToolbox.Bitmap);
  finally
    AToolbox.Free;
  end;
end;

2   L A T E S T    R E P L I E S    (Newest First)
Marius Posted - Mar 28 2014 : 01:49:01
Really? (dang). I created a test application to demonstrate the problem (with my code) and that seems to work now also. Kind of flabbergasted on that but voila if its working my customers would be enormous happy with that..

I ended up with youre code though, much shorter and cleaner!

Thanks for testing!
Marius
w2m Posted - Mar 27 2014 : 10:26:30
I can not duplicate the loss of ruler text with a ruler object here. When I merge a ruler object the text remains visible.

To copy all layers and objects to the clipboard as a bitmap:
procedure TForm1.CopyAsBitmap1Click(Sender: TObject);
{ Copy all layers and objects to the clipboard as a bitmap. }
begin
  { Draw the layers to ImageEnVectPreview1... also draws the objects }
  ImageEnVect1.LayersDrawTo(ImageEnVectPreview1.IEBitmap);
  ImageEnVectPreview1.Update;
  ImageEnVectPreview1.Proc.CopyToClipboard(False);
end;

All objects and layers are visible in the clipboard and the ruler text as well.

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Custom ImageEn Development