The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 image.import.matrix
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

gorlins

USA
Posts

Posted - 07/16/2004 :  3:23:22 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I'm having trouble using the image.import functions (both through Origin C and LabTalk). The code I use is essentially like what's pasted below (i'm certain there isn't a semantic problem in the code). The problem is that the images are only successfully imported occaisionally, and after one import fails (no data is copied into the matrix), Origin has to be restarted before an import will succeed. Half of the time the import will not succeed at all, even after the computer is rebooted. I've even experienced this without recompiling my code, on different days. Has anyone experienced a problem like this?

bool import_image(LPCSTR lpcszMatrix, LPCSTR lpcszFile)
{
Page pg(lpcszMatrix);
if( !pg || EXIST_MATRIX != pg.GetType() )
return false;
string strPage = lpcszMatrix;
if( !lpcszFile )
return false;
using Image = LabTalk.Image;
Image.FileName$ = lpcszFile;
int iErr = Image.Import.Matrix(strPage);
if( iErr )
{
printf("Import Error %d\n", iErr);
return false;
}
pg.LT_execute("matrix -ii"); // show matrix as image
return true;
}

Iris_Bai

China
Posts

Posted - 07/27/2004 :  10:14:43 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

I cannot reporduce your problem. Using the codes below can import image into matrix successfully each time in 7.5 853.

void test()
{
MatrixPage mp;
mp.Create("Origin");
import_image(mp.GetName(), _L("C:\\bs.bmp"));
}



Iris
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000