Search found 971 matches

by utelle
Wed Sep 09, 2020 8:38 am
Forum: wxCode
Topic: wxPdfDocument: Plotting a Rotated Rectangle
Replies: 20
Views: 840

Re: wxPdfDocument: Plotting a Rotated Rectangle

I made a quick experiment with the following result: A rotated rounded rectangle on screen: rounded-rectangle-screen.png and the same rotated rounded rectangle in PDF: rounded-rectangle-pdf.png I used exactly the same drawing code for screen and PDF. As you can see there is no visible shift whatsoev...
by utelle
Tue Sep 08, 2020 4:45 pm
Forum: wxCode
Topic: wxPdfDocument: Plotting a Rotated Rectangle
Replies: 20
Views: 840

Re: wxPdfDocument: Plotting a Rotated Rectangle

m_scaleX and m_scaleY are both equal to 1.0. In that case I really don't have an explanation why the rotated rectangle seems to be shifted. Without seeing the code that was actually executed I'm not able to track down the cause of the problem. That is, I need a sample exhibiting the erroneous behav...
by utelle
Tue Sep 08, 2020 7:04 am
Forum: wxCode
Topic: wxPdfDocument: Plotting a Rotated Rectangle
Replies: 20
Views: 840

Re: wxPdfDocument: Plotting a Rotated Rectangle

This is better, the rectangles display but they are offset down and to the left slightly. See second picture. Most likely this indicates that the translation vector is still not right. Could you please check the values of m_scaleX and m_scaleY in method SetTransformMatrix ? Which values do these va...
by utelle
Mon Sep 07, 2020 6:29 pm
Forum: wxCode
Topic: wxPdfDocument: Plotting a Rotated Rectangle
Replies: 20
Views: 840

Re: wxPdfDocument: Plotting a Rotated Rectangle

I'm sorry Utelle, I got the PPI wrong. The screen DC returns 96, the wxPdfDC returns 1200. GetSize() returns x: 13,200 and y: 10,200 Thanks for the information. I adjusted the translation vector on setting the transformation matrix by taking the resolution into account. Please try the latest wxPdfD...
by utelle
Mon Sep 07, 2020 9:46 am
Forum: wxCode
Topic: Create a PDF with an area filled with a raster pattern
Replies: 16
Views: 302

Re: Create a PDF with an area filled with a raster pattern

Yes, while reading the whole EMF, I came across the need to write elements to PDF that are not used in WMF. As said before, there is only partial support for the WMF format. Even if I decide to enhance the WMF support and/or to add EMF support, there will still be operations that can't be applied t...
by utelle
Sun Sep 06, 2020 9:18 pm
Forum: wxCode
Topic: Create a PDF with an area filled with a raster pattern
Replies: 16
Views: 302

Re: Create a PDF with an area filled with a raster pattern

I'm sorry, I followed the example of WMF, where the PDF code is written directly. That's why I'm at a low-level level. Well, wxPdfDocument supports to add WMF graphics as image objects to a PDF document. This is the high level goal. The PDF specification does not include direct support for WMF grap...
by utelle
Sun Sep 06, 2020 7:40 pm
Forum: wxCode
Topic: Create a PDF with an area filled with a raster pattern
Replies: 16
Views: 302

Re: Create a PDF with an area filled with a raster pattern

My inline image BI /CS/R7 /W 16 /H 8 /BPC 4 /F /AHx ID 00 00 00 00 00 00 00 00 00 00 00 aa 00 00 00 aa a0 00 0a 00 a0 00 0a 00 a0 00 0a 00 a0 00 0a 00 0a 00 a0 00 0a 00 a0 00 0a 00 a0 00 0a 00 a0 00 00 aa 00 00 00 aa 00 00 00 00 00 00 00 00 00 00 > EI Q Instead of describing the goal you want to ac...
by utelle
Sat Sep 05, 2020 11:40 pm
Forum: wxCode
Topic: wxPdfDocument: Plotting a Rotated Rectangle
Replies: 20
Views: 840

Re: wxPdfDocument: Plotting a Rotated Rectangle

The origin is specified in display units. I'm seeing values of x: 6591 and y: 5946 and the rotation is in radians (5.49778). The origin is the center of the rectangle. Well, if you use x: 6591 and y: 5946 as coordinates when drawing to a wxPdfDC with default settings, you are drawing outside the av...
by utelle
Sat Sep 05, 2020 1:13 pm
Forum: wxCode
Topic: wxPdfDocument: Plotting a Rotated Rectangle
Replies: 20
Views: 840

Re: wxPdfDocument: Plotting a Rotated Rectangle

We're using wxMM_TEXT. The DC sample of wxPdfDocument uses wxMM_POINTS. However, due to the value of the default resolution this results in the same scaling factor as wxMM_TEXT. That is, this also doesn't explain the issue. Could you please describe how you derive the translation vector of the tran...
by utelle
Fri Sep 04, 2020 10:17 pm
Forum: wxCode
Topic: wxPdfDocument: Plotting a Rotated Rectangle
Replies: 20
Views: 840

Re: wxPdfDocument: Plotting a Rotated Rectangle

Okay, I've added a screen shot of two rectangles, one rotated and one not as well as two PDF files. One output from our GDI routines (TEST_GDI.pdf) and the other from the wxPdfDoc library (TEST_PDF.pdf). Maybe it will shed some light on what is wrong. I couldn't resist to check the PDF file immedia...
by utelle
Fri Sep 04, 2020 9:07 pm
Forum: wxCode
Topic: wxPdfDocument: Plotting a Rotated Rectangle
Replies: 20
Views: 840

Re: wxPdfDocument: Plotting a Rotated Rectangle

rsb wrote:
Fri Sep 04, 2020 6:50 pm
Okay, I've added a screen shot of two rectangles, one rotated and one not as well
as two PDF files. One output from our GDI routines (TEST_GDI.pdf) and the other
from the wxPdfDoc library (TEST_PDF.pdf). Maybe it will shed some light on what is wrong.
Thanks. I'll take a look over the weekend.
by utelle
Fri Sep 04, 2020 5:19 pm
Forum: wxCode
Topic: wxPdfDocument: Plotting a Rotated Rectangle
Replies: 20
Views: 840

Re: wxPdfDocument: Plotting a Rotated Rectangle

I was using wxWidgets 3.1.0, then upgraded to 3.1.4 but still don't see anything. So obviously the problem you experience is not related to the wxWidgets version. Good to know, even though it doesn't solve the puzzle. I'm running in debug and stepped into the wxpdfdoc code and I do see the new func...
by utelle
Thu Sep 03, 2020 8:58 pm
Forum: wxCode
Topic: wxPdfDocument: Plotting a Rotated Rectangle
Replies: 20
Views: 840

Re: wxPdfDocument: Plotting a Rotated Rectangle

Thanks for updating, but does not seem to be working unless I'm doing something wrong. I see the new functions so I believe I built it correctly but no output at all. Rounded rectangles at 0 degree rotation display correctly. Well, I tested the new functions by adding calls to them locally in the D...
by utelle
Thu Sep 03, 2020 5:32 pm
Forum: wxCode
Topic: Create a PDF with an area filled with a raster pattern
Replies: 16
Views: 302

Re: Create a PDF with an area filled with a raster pattern

If your EMF files contain bitmap images anyway, the easiest approach is to convert them to a bitmap format like PNG beforehand. I've done that for your attached files - see attached zip file. Yes, but these are cutouts of individual areas, and replacement by a raster affects the size of the resulti...
by utelle
Thu Sep 03, 2020 10:17 am
Forum: wxCode
Topic: Create a PDF with an area filled with a raster pattern
Replies: 16
Views: 302

Re: Create a PDF with an area filled with a raster pattern

I have two type areas with raster. EMF atached. If your EMF files contain bitmap images anyway, the easiest approach is to convert them to a bitmap format like PNG beforehand. I've done that for your attached files - see attached zip file. First P2108_200901 have raster type EMR_CREATEDIBPATTERNBRU...