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
 Read BMP image into a 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

Joop.Baltu1

Netherlands
1 Posts

Posted - 07/18/2003 :  07:43:31 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I would like to read a bmp image into an Origin matrix. If I just read the matrix with origin itself I could not find a method to attach this matrix e.g. "Matrix1" to a matrix object. Apparently it is not enough to use the matrix.Attach command.

My trials included the command:
mat.GetPage().ReName(winName);
with as result
(35) :Error, Member function Page::ReName not defined or does not have matching prototype.

It would be even more easy to read the file directly into a new matrix using an origin C command.

regards,

Joop

Edited by - Joop.Baltu1 on 07/18/2003 07:54:02 AM

eparent

118 Posts

Posted - 07/18/2003 :  09:28:39 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Here is a simple OriginC function that will import a specified image file into a specified matrix window.


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;
}



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