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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Import Image default

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
wallacej Posted - 05/25/2005 : 10:49:34 AM
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

3   L A T E S T    R E P L I E S    (Newest First)
eparent Posted - 05/26/2005 : 11:42:03 AM
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);
}


wallacej Posted - 05/26/2005 : 04:31:33 AM
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

Mike Buess Posted - 05/25/2005 : 3:10:34 PM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000