Search found 375 matches

by mael15
Mon Oct 21, 2019 12:39 pm
Forum: C++ Development
Topic: GetMultiLineTextExtent faulty with double 70.xx only?!?
Replies: 1
Views: 36

GetMultiLineTextExtent faulty with double 70.xx only?!?

wxMemoryDC mdc; double fontSize = 69.90; int strWidth = 0; while (fontSize < 71.1) { mdc.SetFont(wxFont(fontSize, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL)); strWidth = mdc.GetMultiLineTextExtent(wxT("test")).GetWidth(); OutputDebugString(wxString::Format(wxT("fontSize %4.2f ->...
by mael15
Tue Sep 10, 2019 2:53 pm
Forum: wxCode
Topic: wxPdfDc semi transparent brush
Replies: 9
Views: 774

Re: wxPdfDc semi transparent brush

This has been fixed in the latest commit on GitHub. Yes, Works now! =D> :D You don't have to tweak the project files. All what is required is to adjust the settings in the file wx_setup.props. Change the lines defining the options wxCompilerPrefix and wxMsvcVersionAuto, so that they look like this:...
by mael15
Fri Sep 06, 2019 6:34 pm
Forum: wxCode
Topic: wxPdfDc semi transparent brush
Replies: 9
Views: 774

Re: wxPdfDc semi transparent brush

Well, you did not reveal earlier that you were using the wxPdfDC template mode. Indeed this did not work due to missing references to the required extended graphics state information. This has been fixed in the latest commit on GitHub. Aaaaaah, okay, nice! I will check it first thing Monday. Thank ...
by mael15
Fri Sep 06, 2019 3:35 pm
Forum: wxCode
Topic: wxPdfDc semi transparent brush
Replies: 9
Views: 774

Re: wxPdfDc semi transparent brush

Sorry, took a while to extract only the relevant code: #pragma once #include <wx/frame.h> #include <wx/app.h> #include <wx/dcbuffer.h> #include <wx/dcgraph.h> #include <wx/pdfdocument.h> #include "wx/pdfdc.h" class MyPanel : public wxPanel { public: MyPanel(wxWindow* par) : wxPanel(par) { Connect(wx...
by mael15
Fri Sep 06, 2019 9:36 am
Forum: wxCode
Topic: wxPdfDc semi transparent brush
Replies: 9
Views: 774

Re: wxPdfDc semi transparent brush

Thank you! It does not work yet. I saw the alpha value was there in SetupAlpha() in > wxpdfdocd.dll!wxPdfDCImpl::DoDrawRectangle(int x, int y, int width, int height) Zeile 791 C++ wxmsw313ud_core_vc_x64_custom.dll!wxDC::DrawRectangle(int x, int y, int width, int height) Zeile 1170 C++ but it does no...
by mael15
Wed Sep 04, 2019 8:07 am
Forum: C++ Development
Topic: wxLocal::AddCatalog not working in 3.1.2.?
Replies: 1
Views: 79

wxLocal::AddCatalog not working in 3.1.2.?

Hi, I recently upgraded to wxWidgets 3.1.2. and some code that worked before does not anymore. I did not change that code for a long time: bool wxTranslationHelperCustom::applyNewDocuLanguage(wxLanguage selLang) { if (GetDocuLocale() && (wxLanguage)GetDocuLocale()->GetLanguage() == selLang) return f...
by mael15
Fri Aug 23, 2019 2:01 pm
Forum: wxCode
Topic: wxPdfDc semi transparent brush
Replies: 9
Views: 774

wxPdfDc semi transparent brush

Hi,
On screen I paint a rectangle with 10% transparency using

Code: Select all

dc->SetBrush(wxColour(col.Red(), col.Green(), col.Blue(), 0x19));
When I create a pdf with wxPdfDc using the same code, this rectangle is not transparent. How can I make it 10% transparent?
Thank you. :)
by mael15
Thu Aug 01, 2019 2:11 pm
Forum: wxCode
Topic: draw rotated bitmap with wxGCDC
Replies: 17
Views: 881

Re: draw rotated bitmap with wxGCDC

utelle wrote:
Thu Aug 01, 2019 1:35 pm
Unfortunately, the sample file is missing from the post.
maybe it works this time, only attached and not placed inline?
But like I wrote, I do not need this anymore, rotating the whole wxPdcDocument works great and leads to smaller pdfs that are created faster.
by mael15
Thu Aug 01, 2019 12:18 pm
Forum: wxCode
Topic: draw rotated bitmap with wxGCDC
Replies: 17
Views: 881

Re: draw rotated bitmap with wxGCDC

Could you show a sample drawing? Here is one, it is 600dpi, only the circles bitmap took 7.7 seconds to draw to wxPdfDC. As you can see not everything on the page needs to be rotated. sampleOver7sec.zip I still think that creating a PDF template without applying rotation, and then adding the templa...
by mael15
Wed Jul 31, 2019 4:17 pm
Forum: wxCode
Topic: draw rotated bitmap with wxGCDC
Replies: 17
Views: 881

Re: draw rotated bitmap with wxGCDC

So I could reduce draw time by reducing the resolution (obviously), but I noticed one funny thing: wxMask does only work in my app 209dpi upwards. This is not the case with the sample code in the previous post. Is there any restriction, maybe bitmap size?
by mael15
Wed Jul 31, 2019 1:53 pm
Forum: wxCode
Topic: draw rotated bitmap with wxGCDC
Replies: 17
Views: 881

Re: draw rotated bitmap with wxGCDC

You may have reasons for your approach to create a bitmap of a whole page first, but then you don't take advantage of the PDF vector drawing capabilities. Well, yes, as we discussed in this thread, I need to rotate everything I draw, but wxPdfDC does not support wxGCDC so I have to use wxGCDC with ...
by mael15
Wed Jul 31, 2019 9:15 am
Forum: wxCode
Topic: draw rotated bitmap with wxGCDC
Replies: 17
Views: 881

Re: draw rotated bitmap with wxGCDC

Well, your bitmap seems to be rather large. And unfortunately bitmaps can't be transferred to PDF directly. They have to be converted to a known graphics format like PNG or JPEG. wxPdfDC: DrawBitmap converts a wxBitmap object to a wxImage object first, and then converts the wxImage to JPEG format. ...
by mael15
Wed Jul 31, 2019 8:42 am
Forum: wxCode
Topic: draw rotated bitmap with wxGCDC
Replies: 17
Views: 881

Re: draw rotated bitmap with wxGCDC

One more question about wxPdfDC: DrawBitmap takes ~7 seconds for a 4700x5800px bitmap. Is there any way to speed it up?
by mael15
Fri Jul 26, 2019 1:11 pm
Forum: wxCode
Topic: draw rotated bitmap with wxGCDC
Replies: 17
Views: 881

Re: draw rotated bitmap with wxGCDC

utelle wrote:
Tue Jul 23, 2019 6:37 pm
The only approach based on the current implementation of wxPdfDC, I can imagine, is to use the template mode of wxPdfDC
Okay, thank you, I hope it will be possible to use wxGCDC some time in the future. Until then I will draw incl. rotation to a wxMemoryDC and copy it to the wxPdfDc after.
by mael15
Mon Jul 22, 2019 8:05 am
Forum: wxCode
Topic: draw rotated bitmap with wxGCDC
Replies: 17
Views: 881

Re: draw rotated bitmap with wxGCDC

If i puzzle the pieces together, i assume you're using wxDC::SetTransformMatrix() which is not supported by wxPdfDC? What I mean is I cannot create a wxGCDC from a wxPdfDC. Up to now support for manipulating the transformation matrix was not added to wxPdfDC. The only two things I do with wxGDC are...