problem about view->fit()

Valued Contributor
Valued Contributor

 

Hello Jason,

now I have a problem about view->fit():

I get the ApplicationPtr appPtr,;

appPtr ->PutVisible (VARIANT_FALSE) ;//here the Application is invisible.

SolidEdgeDocumentPtr sDoc = appPtr->GetDocuments()->open(fileName,0,false);//the file is invisible, too.

but now I want to save the 2D-Image of this file,

WindowPtr wDoc = sDoc->GetWindows()->Item(1);

ViewPtr view = wDoc->GetView();

HRESULT hr = view->Fit();//hr = S_OK

if(SUCCEEDED(hr))

hr = view->SetRenderMode(SolidEdgeFramework::seRenderModeSmooth);//hr = S_OK

if(SUCCEEDED(hr))

view->SaveAsImage(fName, IMG_WIDTH,IMG_HEIGHT,100,0,0,SolidEdgeFramework::seImageQualityHigh,false);

But the result is the same as the result without using the function Fit() and setRenderMode (...).

any ideas?

thanks

 

 

 

 

 

Posted by: Julia Schneider
Post date: 6/20/2007 1:29:49 AM

5 REPLIES

RE: problem about view->fit()

Valued Contributor
Valued Contributor

 

Julia,

Does it work correctly if you remark out this line of code?

 appPtr ->PutVisible (VARIANT_FALSE) ;//here the Application is invisible.

 

 

Posted by: Jason Newell
Post date: 6/20/2007 1:23:28 PM

RE: problem about view->fit()

Valued Contributor
Valued Contributor

Hello Jason,

 

yes, it works without this line of code. But if I don't want to see the application, how can I do that?

 

thanks

 

 

 

Posted by: Julia Schneider
Post date: 6/29/2007 12:31:58 AM

RE: problem about view->fit()

Valued Contributor
Valued Contributor

Hi Julia,

 

Unfortunately, you can't use the SaveAsImage method when SE is not visible. You have to have the application visible on the monitor otherwise you get empty images.

 

Cheers

Calum

 

P.S. I haven't tried this since V16 but I'm pretty sure nothing has changed

 

Posted by: Calum McLellan
Post date: 6/30/2007 5:51:59 AM

RE: problem about view->fit()

Valued Contributor
Valued Contributor

 

Hello Calum,

I can use the SaveAsImage method when SE (V17) is not visible (I can get the image), but  the method view->fit() dosen't work.

any ideas?

Julia

 

 

Posted by: Julia Schneider
Post date: 7/1/2007 11:42:12 PM

RE: problem about view->fit()

Valued Contributor
Valued Contributor

Julia,

 

I imagine that this method requires SE to be visible (it would need the size of the active window to work). I'm not 100%, so you could try logging an IR.

 

Sorry I can't be of more help.

Cheers

Calum

 

Posted by: Calum McLellan
Post date: 7/2/2007 1:41:11 AM