download_palette


Description

download color palette from the internet

Syntax

int download_palette( LPCSTR lpcszURL, LPCSTR lpcszPALfilename = NULL )

Parameters

lpcszURL
[input] online palette file url
lpcszPALfilename
[input] destination file fullpath name

Return

0 if SUCCESS or a error number

Examples

EX1

#include <..\originlab\palette_utils.h>

void download_palette_ex()
{
	//online palette file url
    string strURL = "https://www.benjaminmoore.com/-/media/sites/benjaminmoore/files/palettedownloads/ase/en-us/benjaminmoore_off-whitecolors_en-us.ase";
    
    //prepare local file 
    string strPALFile = GetAppPath() + GetFileName(strURL, true)+".pal";
	
    //download the online file and save it as .pal file
    int nRet = download_palette(strURL, strPALFile);
	if(0 == nRet)
		printf("online file:\n%s\nis saved as:\n%s\n", strURL, strPALFile);  
	else
		out_str("fail");
}

Remark

See Also

header to Included

palette_utils.h

Reference