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
 CopyObjectsToBack: CopyText of a ruler is not copi
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Marius

Netherlands
21 Posts

Posted - Mar 27 2014 :  02:36:45  Show Profile  Reply
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;

w2m

USA
1990 Posts

Posted - Mar 27 2014 :  10:26:30  Show Profile  Reply
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
Go to Top of Page

Marius

Netherlands
21 Posts

Posted - Mar 28 2014 :  01:49:01  Show Profile  Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: