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
 Forum for Origin C
 Image export settings - setting DPI does not work

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
additive Posted - 06/23/2009 : 2:05:09 PM
OriginPro 8.0 SR4
Windows XP

Hi,
I've already spent hours to figure out how to export a graph to EMF format using the required DPI size (via OC of course).

export_page_to_image()
seems to regard the DPI parameter only for bitmap files.

Saving the dialog settings to an OIS theme file and loading it via
theme_load_settings(trExportSettings, strPath);

and then running
export_page( pg, strFileName, trSettings);

causes "unattached wrapper class members" ...

I've looked into GraphicalExport.c but couln't find anything helpful ..

Anyone experienced in graph export settings? Thank you for sharing any piece of advice!

-Michael


4   L A T E S T    R E P L I E S    (Newest First)
additive Posted - 06/25/2009 : 02:41:14 AM
Hey, this is really great!
Thank you very much!
I've already used the picture alignment parameter, but since I was focused on top alignment I overlooked this setting. Works perfect now! Once again, thanks for your quick response!

-Michael
Iris_Bai Posted - 06/24/2009 : 11:02:01 PM
Hi Michael,

You can use the following codes to format flex grid to show whole picture in one cell.


m_oFlexGrid.Cell(flexcpPictureAlignment, nRow, nCol) = flexPicAlignStretch; // to show whole graph

// set row height with the original ratio
int nPictureHeight = 2463; //pixel
int nPictureWidth  = 3216; //pixel
double dAspectRatio = (double) nPictureHeight / nPictureWidth;

RECT rect; 
GetCellRect(nRow, nCol, rect);
int ny = PixelsToTwips((rect.right - rect.left) * dAspectRatio);
m_oFlexGrid.RowHeight(nRow) = ny;			


Iris
additive Posted - 06/24/2009 : 4:24:16 PM
Hi Easwar,
thank you for your quick response!

quote:
Originally posted by easwar
For EMF export, which is a vector type, DPI setting does not apply....one should be able to set the Width or Height of the export, and then the receiving application (such as Word) uses that info to render the image to have the set width/height.


I know this but I figured out that using the dialog from the file menu (export graph) the DPI setting results in different 1:1 representations in other applications. So in general Origin indeed seems to be able to export properly. That's why I tried to use the OIS settings as a workaround. Maybe you can have a look into this direction?

Unfortunately, I'm not able to set the dimensions at the output destination. I'm trying to include graph pages into flexGrid cells, which works pretty well for bitmaps, but EMF files are displayed so huge that one can see only some letters of the axis label.


	PictureHolder pictHolder;	
	HENHMETAFILE hEMF = load_enhanced_metafile(strEMFPath); 
	pictHolder.CreateFromEnhMetafile(hEMF, true);
	bool bRet = SetCellPicture(nCol, nRow, pictHolder);	

and using

bool CFlexGridWrapperBOR::SetCellPicture(int nCol, int nRow, PictureHolder &pict)
{
	_VARIANT vtPic;
	vtPic = pict;
	m_oFlexGrid.Cell(flexcpPicture, nRow, nCol) = vtPic;
	return TRUE;
}

Unfortunately, only PictureControl objects can be scaled to fit their placeholder.

A (working) direct attach method would be even nicer:

bool CFlexGridWrapperBOR::SetCellEMF(int nCol, int nRow, GraphPage gp)
{
	PictureHolder pictHolder;
	page_get_picture(gp, pictHolder, "EMF", 72, false);
	bool bRet = SetCellPicture(nCol, nRow, pictHolder);	
	return bRet;
}


Browsing OriginLabs' code I've found so many different export and attach methods, so I still hope one of them could be useful for this purpose ...

Michael

easwar Posted - 06/24/2009 : 12:25:30 PM
Hi Michael,

For EMF export, which is a vector type, DPI setting does not apply....one should be able to set the Width or Height of the export, and then the receiving application (such as Word) uses that info to render the image to have the set width/height.

This works correctly with WMF (from the expgraph XF dialog), I can set say width to be 2 inches, and when placed in Word i get an image that is exactly 2 inches.

The above (from GUI) does not work for EMF, so there appears to be a bug/issue with setting size with EMF, this is trackered as QA#13843 and we are looking into this issue.

I did not test from OC, but it is possible OC-width-settings for EMF are also being ignored/not set, as the expGraph tool uses OC to do the export.

Easwar
OriginLab

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