Components for Developers
© 2000-2012, Two Pilots

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF-X Pilot History In the Lab

PDF Creator Pilot documentation

Download CHM version of this manual.
How to Use Blend Modes

Example
Collapse All

Example

C++

[copy to clipboard]
PM_DOCUMENT doc = PM_DOCUMENT_New();
PM_RECT rect = {0, 0, 500, 500};
PM_PAGE page = PM_DOCUMENT_AddPage(doc, rect);
PM_CANVAS canvas = PM_PAGE_GetCanvas(page);

/* PM_BLEND_MODE
	bmNormal = 0,
	bmMultiply = 1,
	bmScreen = 2,
	bmOverlay = 3,
	bmDarken = 4,
	bmLighten = 5,
	bmColorDodge = 6,
	bmColorBurn = 7,
	bmHardLight = 8,
	bmSoftLight = 9,
	bmDifference = 10,
	bmExclusion = 11,
	bmHue = 12,
	bmSaturation = 13,
	bmColor = 14,
	bmLuminosity = 15
*/

// PM_BLEND_MODE bmHue
PM_BLEND_MODE bmBlMode = bmHue;
PM_CANVAS_SetBlendMode(canvas, bmBlMode);

PM_CANVAS_SetRGBColorFill(canvas, 1.0f, 0.0f, 0.0f);
PM_CANVAS_DrawCircle(canvas, 100, 100, 75);
PM_CANVAS_FillAndStroke(canvas);

PM_CANVAS_SetRGBColorFill(canvas, 0.0f, 1.0f, 0.0f);
PM_CANVAS_DrawCircle(canvas, 150, 150, 75);
PM_CANVAS_FillAndStroke(canvas);

PM_CANVAS_SetRGBColorFill(canvas, 0.0f, 0.0f, 1.0f);
PM_CANVAS_DrawCircle(canvas, 200, 100, 75);
PM_CANVAS_FillAndStroke(canvas);

// PM_BLEND_MODE bmScreen
bmBlMode = bmScreen;
PM_CANVAS_SetBlendMode(canvas, bmBlMode);

PM_CANVAS_SetRGBColorFill(canvas, 1.0f, 0.0f, 0.0f);
PM_CANVAS_DrawCircle(canvas, 400, 250, 75);
PM_CANVAS_FillAndStroke(canvas);

PM_CANVAS_SetRGBColorFill(canvas, 0.0f, 1.0f, 0.0f);
PM_CANVAS_DrawCircle(canvas, 350, 200, 75);
PM_CANVAS_FillAndStroke(canvas);

PM_CANVAS_SetRGBColorFill(canvas, 0.0f, 0.0f, 1.0f);
PM_CANVAS_DrawCircle(canvas, 300, 250, 75);
PM_CANVAS_FillAndStroke(canvas);

// PM_BLEND_MODE bmDarken
bmBlMode = bmDarken;
PM_CANVAS_SetBlendMode(canvas, bmBlMode);

PM_CANVAS_SetRGBColorFill(canvas, 1.0f, 0.0f, 0.0f);
PM_CANVAS_DrawCircle(canvas, 100, 400, 75);
PM_CANVAS_FillAndStroke(canvas);

PM_CANVAS_SetRGBColorFill(canvas, 0.0f, 1.0f, 0.0f);
PM_CANVAS_DrawCircle(canvas, 150, 350, 75);
PM_CANVAS_FillAndStroke(canvas);

PM_CANVAS_SetRGBColorFill(canvas, 0.0f, 0.0f, 1.0f);
PM_CANVAS_DrawCircle(canvas, 200, 400, 75);
PM_CANVAS_FillAndStroke(canvas);

PM_DOCUMENT_Save(doc, "BlendMode.pdf");
PM_DOCUMENT_Free(doc);

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF-X Pilot History In the Lab

 

 

PDF Library | Virtual Printer | Converters to PDF

Support | Blog | Forum | Contacts

© 2000-2012, Two Pilots