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
 LabTalk Forum
 Import Image default
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

wallacej

UK
Posts

Posted - 05/25/2005 :  10:49:34 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (7.5):
Operating System: win2k

Hi

I use the following line to allow the user to choose an image to place on their Origin report:

run.section(imgfile, ImportImage);

The default image type in the dialog is *.bmp and I would like for it to be *.jpg. Is this possible?

I did try and trace backwards but couldn't get any further back than the imgfile file.

Thank You

Wallace

Mike Buess

USA
3037 Posts

Posted - 05/25/2005 :  3:10:34 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Wallace,

The brute force but effective approach is to reorder the extension list. Change the ImportImage section of imgfile.ogs to this...
[ImportImage]
Image.GetExtList(z,im);
%L=JPG;
for(i=1;i>0;i++)
{
%A=%[%Z,#i]; if(%A=="") break;
if(%A!="JPG") %L=%L %A;;
}
%Z=%L;
image.filedlg.filetypes$=%Z;
if(Image.FileDlg.Open(Z))
return 1;
Image.FileName$="%Z";
if(exist(%H)==5)
{
run.section(,LoadImageIntoMatrix);
}
else
{
run.section(,LoadImageIntoGrObject);
}
Alternatively, you can offer the users only the JPG extension like this...
[ImportImage]
//Image.GetExtList(z,im);
image.filedlg.filetypes$=JPG;
if(Image.FileDlg.Open(Z))
return 1;
Image.FileName$="%Z";
if(exist(%H)==5)
{
run.section(,LoadImageIntoMatrix);
}
else
{
run.section(,LoadImageIntoGrObject);
}


Mike Buess
Origin WebRing Member
Go to Top of Page

wallacej

UK
Posts

Posted - 05/26/2005 :  04:31:33 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks Mike

Brute force is a solution that I am happy to use!

It worked great and now the users are pleased with the lesser time to produce their reports.

Wallace

Go to Top of Page

eparent

118 Posts

Posted - 05/26/2005 :  11:42:03 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Another, perhaps cleaner, solution is to set the Image.FileDlg.FileType property to the index of JPG. Using Mike's 'for' loop you would check for JPG and when found set the property.


[ImportImage]
Image.GetExtList(z,im);
image.filedlg.filetypes$=%Z;
//-------- begin change
for(i=1;i>0;i++)
{
%A=%[%Z,#i]; if(%A=="") break;
if(%A=="JPG") {image.filedlg.filetype = i; break;}
}
//-------- end change
if(Image.FileDlg.Open(Z))
return 1;
Image.FileName$="%Z";
if(exist(%H)==5)
{
run.section(,LoadImageIntoMatrix);
}
else
{
run.section(,LoadImageIntoGrObject);
}


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