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 area of image but floating point error.
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

adisonx

Thailand
29 Posts

Posted - Jan 26 2015 :  22:29:30  Show Profile  Reply
I want to print the area of image ,but I get "floating point invalid operation at 0x00a0fa06" error and here is my code.

if (this->ImageEnView->Selected) {



if (this->PrintDialog->Execute()) {
TImageEnIO* ImageEnIO = new TImageEnIO(this);
Printer()->Copies = this->PrintDialog->Copies;
TMemoryStream* mem = new TMemoryStream();
this->ImageEnView->SaveSelectionToStream(mem); //save area to temporary stream
mem->Position = 0;
Printer()->BeginDoc();
ImageEnIO->LoadFromStream(mem);
ImageEnIO->PrintImage(Printer()->Canvas, 0, 0, 0, 0, ievpTop,
iehpLeft, iesNormal, 0, 0, 1);
Printer()->EndDoc();

delete mem;
delete ImageEnIO;
}

}

What 's wrong with my code and how do I fix this. Thank you in advance.

---Update
My mistake SaveSelectionToStream method is only save the selection not image content,but how do I get image area content.

xequte

39138 Posts

Posted - Jan 27 2015 :  13:02:32  Show Profile  Reply
Hi

Please use:

this->ImageEnView->IO->SaveToStream(mem);

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: