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
 print selected region from a imageenvect1
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

peberhardt

Germany
21 Posts

Posted - Mar 31 2017 :  04:00:43  Show Profile  Reply
Hello,

i use imageenvect1 for CAD Plan

i need print a section from a plan

this code is not work...


if not imageenvect1.Selected then
  begin
    ShowMessage('Please select an image region');
    exit;
  end;

  tempbmp := TBitmap.Create;
  io := TImageEnIO.Create(self);
  io.AttachedBitmap := tempbmp;
  imageenvect1.CopySelectionToBitmap(tempbmp);
  io.DoPrintPreviewDialog(iedtDialog, '');
  io.free;
  tempbmp.free;


i use this to print All:

imageenvect1.IO.DoPrintPreviewDialog(iedtDialog,'');


give a solution for print a selected region?

best regards peter

w2m

USA
1990 Posts

Posted - Mar 31 2017 :  10:15:01  Show Profile  Reply
I modified your code a little bit and it works correctly here:
procedure TForm1.PrintSelection1Click(Sender: TObject);
var
  iIEBitmap: TIEBitmap;
  iImageEnIO: TImageEnIO;
begin
  if not ImageEnVect.Selected then
  begin
    MessageBox(0, 'Please select an image region.', 'Warning', MB_ICONWARNING or MB_OK);
    Exit;
  end;
  iIEBitmap := TIEBitmap.Create;
  try
    iImageEnIO := TImageEnIO.Create(nil);
    try
      iImageEnIO.AttachedIEBitmap := iIEBitmap;
      ImageEnVect.CopySelectionToBitmap(iIEBitmap);
      iImageEnIO.DoPrintPreviewDialog(iedtDialog, '');
    finally
      iImageEnIO.Free;
    end;
  finally
    iIEBitmap.Free;
  end;
end;



Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: