drawsetresolution and drawgetresolution
Posted: 2010-11-21T16:07:40-07:00
Relating to viewtopic.php?t=17486&p=65761 i think it'd make more sense if a drawsetresolution and drawgetresolution to set and retrieve the density was added to the api. This would allow much simpler access to the density property.
To set the resolution:
and to retrieve the resolution, I'm not sure of a "magick" way to split the x and y vars
thanks
To set the resolution:
Code: Select all
WandExport MagickBooleanType DrawSetResolution(DrawingWand *wand, const double x_resolution,const double y_resolution)
{
char
density[MaxTextExtent];
assert(wand != (DrawingWand *) NULL);
assert(wand->signature == WandSignature);
if (wand->debug != MagickFalse)
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
(void) FormatMagickString(density,MaxTextExtent,"%gx%g",x_resolution, y_resolution);
(void) CloneString(&CurrentContext->density,density);
return(MagickTrue);
}
Code: Select all
WandExport MagickBooleanType DrawGetResolution(DrawingWand *wand, double *x,double *y)
{
assert(wand != (DrawingWand *) NULL);
assert(wand->signature == WandSignature);
if (wand->debug != MagickFalse)
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
// density needs to be split here unless there's a helper function?
// not sure how to extract first resolution part *x=;
// as above *y=;
return(MagickTrue);
}