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
 Differences in Exporting JPGs in 6.0 vs. 6.1
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

CStorey

Canada
137 Posts

Posted - 11/17/2000 :  3:31:46 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
The following code which runs quite well in 6.0, does not work in 6.1. Can anyone tell me why?



image.filename$=%L%H.%V;
image.exportpixel(%V,pic_width,pic_height,24,0);
image.filename$=%Lsmall$(ii).%V;
image.exportpixel(%V,128,96,24,0);

where %V="JPG" and %L=full path



I can't find any reasons for the failure.
Craig

eparent

118 Posts

Posted - 11/17/2000 :  6:24:46 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The Image object now has the ability to import images into a matrix and export a matrix to an image. With this new ability we thought it would be best to add Export and Import subobjects.

Keeping the arguments the same you will need to replace your call to
Image.ExportPixel
with
Image.Export.PagePixel
Go to Top of Page

CStorey

Canada
137 Posts

Posted - 11/20/2000 :  3:53:03 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks for the tip. Is there documentation on this in any of the LabTalk help files??

Craig

Go to Top of Page

Barb Tobias

USA
305 Posts

Posted - 11/27/2000 :  11:04:43 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Craig,
Unfortunately the image object wasn't fully documented in the 6.1 LabTalk Help file.
Here is the complete information:

LabTalk's Image Object

Properties:

FileName$ - read/write, string
Use to specify the source and destination file name.

LibError - read only, numeric
Equals the last error that occured in a third-party library. The image object is handled by the OIMG60 DLL. This DLL makes calls to third-party libraries. If an error occurs in a third party library then LibError will be set to the error number returned by the third-party library.

ShowOptions - read/write, numeric
Used to specify if the Options dialog should be displayed when the image.export methods are called.


Methods:

GetExtList( strvar, list )
Get a list of supported file extensions and put it into strvar.
The extensions depends on the value of list. list can be one of the following:
"EP" = Export Page
"EM" = Export Matrix
"IM" = Import Matrix
"R" = Raster
"V" = Vector
Returns the number of extensions copied into strvar or -1 for error.

IsVector( extension )
Test if the specified extension is a vector format.
Returns 1 if format is vector else 0.


Export SubObject:

Properties:

TempRaster - read/write, numeric
When exporting to a raster format Origin creates a temporary image that will be converted to the destination image by the third-party library. Origin can pass an EMF or a BMP to the third-party library. Each format has its advantages and disadvantages. This property specifies which format to use.
0 = EMF
1 = BMP
2 = BMP first, if BMP not successful then EMF
Option two exists because high resolution BMPs can quickly consume lots of memory and Windows 95 and 98 are limited to 16MB BMPs in memory. If the BMP fails to be created then Origin will try an EMF.

VectorKeepSize - read/write, numeric
When exporting vector formats Origin will pass an EMF to the third-party library. EMFs and WMFs are created using the settings in the Copy/Export Page Settings of the Tools: Options: Page dialog. If VectorKeepSize is 0 then the metafile is created using the settings in the dialog. If VectorKeepSize is 1 then the metafile is created using the following settings:

Ratio = 100
System.CopyPage.Ratio = 100

Margin Control = Page
System.CopyPage.Closeness = 2

Advanced On (Simple Off)
System.CopyPage.Advanced = 1

Keep Size On (Set Resolution Off)
System.CopyPage.AdvKeepSize = 1

Methods:

Matrix( matrix_name, image_type )
Export a matrix window to a raster grey scale image.
matrix_name is the name of the matrix window to export.
image_type is the destination image type.
The destination file name is specified in Image.FileName$.
Example:
Image.FileName$="myimage.bmp";
Image.Export.Matrix(Matrix1, BMP);

PageDPI( image_type, dots_per_inch, bits_per_pixel, compression )
Export the active graph or layout window to an image using a dots per inch resolution.
bits_per_pixel is the color depth. Not all image types support all color depths. If the color depth specified is not supported by the specified image type then Origin will use the best matching color depth supported by the specified image type.
compression is the type of compression to use. Not all formats support compression.
JPG can be from 2 to 255.
TIF can be 0=none, 1=packbits, 2=LZW (if enabled)
The destination file name is specified in Image.FileName$.
Example:
Image.FileName$="myimage.bmp";
Image.Export.PageDPI( BMP, 96, 24, 0 );


PagePixel( image_type, width_in_pixels, height_in_pixels, bits_per_pixel, compression )
Export the active graph or layout window to an image using a width and height in pixel resolution.
bits_per_pixel is the color depth. Not all image types support all color depths. If the color depth specified is not supported by the specified image type then Origin will use the best matching color depth supported by the specified image type.
is the type of compression to use. Not all formats support compression.
JPG can be from 2 to 255. 2 is high quality, low compression. 255 is low quality, high compression.
TIF can be 0=none, 1=packbits, 2=LZW (if enabled)
The destination file name is specified in Image.FileName$.
Example:
Image.FileName$="myimage.bmp";
Image.Export.PagePixel( BMP, 640, 480, 24, 0 );



Import SubObject:

Methods:

Matrix( matrix_name )
Import an image into a matrix.
matrix_name is the name of the destination matrix window.
The source image file is specified in Image.FileName$.
Example:
Image.FileName$="myimage.bmp";
Image.Export.Matrix(Matrix1, BMP);




FileDlg SubObject:

Properties:

Title$ - read/write, string
Dialog's title/caption. If set to "" then Windows default captions are used.

Path$ - read/write, string
Default and ending path.

FileName$ - read/write, string
Default and ending file name.

FileTypes$ - read/write, string
Image types to display in the dialog's "Files of type" list.
This should be set to a list of image types returned by the image.GetExtList method.

FileType - read/write, numeric
The index of the default and ending image type in the dialog's "Files of type" list.

Preview - read/write, numeric
Set to 1 to enable or 0 to disable the dialog's preview window.


Methods:

Open( strvar )
Show the file open dialog. If the optional strvar is specified then the string variable will contain the full file name if the dialog closes on OK or Open.
Example:
Image.FileDlg.Open();

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