Print Page | Close Window

Is alpha transparent supported in NewPagFromCanvDC

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2733
Printed Date: 31 May 25 at 10:10AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Is alpha transparent supported in NewPagFromCanvDC
Posted By: cathyling
Subject: Is alpha transparent supported in NewPagFromCanvDC
Date Posted: 17 Sep 13 at 4:37PM

Hi, I am tring to use gdiplus create a transparent brush. The NewPageFromCanvasDC can't fill if the Color alpha value <255.

Codes:

HDC dc = QP.GetCanvasDC(1000,800);
Graphics myGraphics(dc);
Color colors[] = {
      Color(255, 255, 0, 0),   // red
      Color(155, 0, 0, 255),   // blue
      Color(55, 0, 255, 0)};  // green

REAL positions[] = {  0.0f,     0.3f,   1.0f};

LinearGradientBrush linGrBrush3( Point(0, 0), Point(300, 0),Color(255, 0, 0, 0),  Color(255, 255, 255, 255));

linGrBrush3.SetInterpolationColors(colors, positions, 3);
myGraphics.FillRectangle(&linGrBrush3, 220, 220, 500, 650);

QP.NewPageFromCanvasDC(300, -1);

 
Can anyone help me? Thanks.



Replies:
Posted By: AndrewC
Date Posted: 18 Sep 13 at 4:48AM
cathylin,

 
I have had a quick look at the source code.  The Gradient fills are supported but brush transparency is not supported.

This could get quite complex to implement as it is not always easy to map GDI+ calls to PDF.  I will add it to the todo list for the GDI+ metafile code.

Andrew.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk