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
 print selected region from a imageenvect1

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
peberhardt Posted - Mar 31 2017 : 04:00:43
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
1   L A T E S T    R E P L I E S    (Newest First)
w2m Posted - Mar 31 2017 : 10:15:01
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