Search found 491 matches

by mael15
Fri Sep 17, 2021 3:57 pm
Forum: wxCode
Topic: wxPDF wxBRUSHSTYLE substitude
Replies: 17
Views: 1195

Re: wxPDF wxBRUSHSTYLE substitude

You will see that if you display the PDF document in a PDF viewer and set the magnification factor to 800%, for example. You will see that the rectangle is hatched as requested. Yes!!!! I did not think of zooming in, great! Sounds right that the resolution is probably the cause for this very dense ...
by mael15
Fri Sep 17, 2021 12:50 pm
Forum: wxCode
Topic: wxPDF wxBRUSHSTYLE substitude
Replies: 17
Views: 1195

Re: wxPDF wxBRUSHSTYLE substitude

i am confused, so can I use wxDC::DrawRectangle or do I have to use wxPdfDocument::Rect ? The former would be easier, but it does not show wxBRUSHSTYLE_BDIAGONAL_HATCH yet. I use this code: wxPdfDocument pdfDcmt; pdfDcmt.SetCompression(false); ... pdfDcmt.AddPage(orient, papSize); int tpl = pdfDcmt....
by mael15
Fri Sep 17, 2021 9:09 am
Forum: wxCode
Topic: wxPDF wxBRUSHSTYLE substitude
Replies: 17
Views: 1195

Re: wxPDF wxBRUSHSTYLE substitude

hi ulrich, unfortunately I could not get it to work with the latest version. I attached both failures, one from the png pattern and one with wxPDF_PATTERNSTYLE_BDIAGONAL_HATCH. Do I understand it correctly that this is not possible, I have to work with wxPDF pattern? dc.SetBrush(wxBrush(ecBlue, wxBR...
by mael15
Tue Sep 14, 2021 12:10 pm
Forum: wxCode
Topic: wxPDF wxBRUSHSTYLE substitude
Replies: 17
Views: 1195

Re: wxPDF wxBRUSHSTYLE substitude

i can confirm that it is not a blank page anymore, but there is no pattern using the code posted previously. I can wait for a hatched brush and not worry about the pattern though.
thank you for fixing this so fast! =D>
by mael15
Fri Sep 10, 2021 8:29 am
Forum: wxCode
Topic: wxPDF wxBRUSHSTYLE substitude
Replies: 17
Views: 1195

Re: wxPDF wxBRUSHSTYLE substitude

I fear you detected a deficiency of the current wxPdfDocument version. For templates it is required to list all resources they depend on. This is done for fonts and images, but unfortunately not for patterns. I will try to fix this issue. However, this may take a few days, because I have a rather t...
by mael15
Thu Sep 09, 2021 2:57 pm
Forum: wxCode
Topic: wxPDF wxBRUSHSTYLE substitude
Replies: 17
Views: 1195

Re: wxPDF wxBRUSHSTYLE substitude

this is the basic level of creating the pdf, the actual drawing happens depp within printToDC wxPdfDocument pdfDcmt; pdfDcmt.SetCompression(false); wxFont defaultFont(wxFontInfo(10).Family(wxFONTFAMILY_DEFAULT).Underlined(false)); wxPdfFont pdfArialFont = wxPdfFontManager::GetFontManager()->Register...
by mael15
Thu Sep 09, 2021 1:07 pm
Forum: wxCode
Topic: wxPDF wxBRUSHSTYLE substitude
Replies: 17
Views: 1195

Re: wxPDF wxBRUSHSTYLE substitude

okay, thank you! i changed the code like this: wxImage img = SystemState::loadImage(wxT("images/pdfhatch.png")); pdfDcmt.AddPattern(wxS("bluehatch"), img, 2, 2); wxPdfArrayDouble dash2; wxPdfLineStyle style2(0.5, wxPDF_LINECAP_BUTT, wxPDF_LINEJOIN_MITER, dash2, 0., wxColour(255, 0, 0)); pdfDcmt.SetL...
by mael15
Tue Sep 07, 2021 9:04 am
Forum: wxCode
Topic: wxPDF wxBRUSHSTYLE substitude
Replies: 17
Views: 1195

Re: wxPDF wxBRUSHSTYLE substitude

thank you! i tried it but only get an empty page without any error message. what I am doing is this after successfully loading via wxImage::LoadFile(path) pdfDcmt.AddPattern(wxS("bluehatch"), img, 32, 32); ... pdfDcmt.SetFillPattern(wxS("bluehatch")); pdfDcmt.Rect(pnt.x, pnt.y, sz.GetWidth(), sz.Get...
by mael15
Fri Sep 03, 2021 7:44 am
Forum: wxCode
Topic: wxPDF wxBRUSHSTYLE substitude
Replies: 17
Views: 1195

wxPDF wxBRUSHSTYLE substitude

So I found in some other post that wxBRUSHSTYLE is not supported in wxPDFDoc and that wxPdfPattern might be an alternative? I could not find an example on how to do that. I need to mark an area on a bitmap and a simple rectangle is not an option. The inside of the rectangle has to have some sort of ...
by mael15
Mon Aug 30, 2021 8:55 am
Forum: Compiler / Linking / IDE Related
Topic: visual studio code suggestions wxWidgets
Replies: 2
Views: 623

Re: visual studio code suggestions wxWidgets

Thanx! It kind of worked, now these keywords are colored again. I found the solution: I still did not have the auto completion, so when I type "wxDef", I wanted to get the options "wxDefaultPosition", "wxDefaultSize" etc. which is a real time saver. This is a function of he extension visual assist a...
by mael15
Sun Aug 29, 2021 3:34 pm
Forum: Compiler / Linking / IDE Related
Topic: visual studio code suggestions wxWidgets
Replies: 2
Views: 623

visual studio code suggestions wxWidgets

hi, my visual studio 16.11.2 enterprise 2019 stopped showing auto suggestion for wxWidgets elements like wxPoint or wxDefaultPosition. I recently changed to the latest wxWidgets 3.1.5 and compiled from source with default settings. Did I miss to compile something or how do I get these basic code sug...
by mael15
Fri Aug 13, 2021 11:28 am
Forum: wxCode
Topic: wxPDFDocument speed up DrawLines
Replies: 15
Views: 2990

Re: wxPDFDocument speed up DrawLines

For me it goes from 0.03 s with penwidth = 1, to 57s with penwidth = 2 The gap grows bigger with more points, my times in the last post were with 1000, yours with my initial 10700. Using the Direct2D renderer brings the time down to 4s, but that's still not good enough for realtime. Maybe you can u...
by mael15
Fri Aug 13, 2021 10:07 am
Forum: wxCode
Topic: wxPDFDocument speed up DrawLines
Replies: 15
Views: 2990

Re: wxPDFDocument speed up DrawLines

okay, one step further, it is not bitmap size but pen width. wxLongLong startTime, timeSpan; const int numPoints = 1000; wxPoint pntArr[numPoints]; for (int i = 0; i < numPoints; i++) pntArr[i] = wxPoint(rand() % 1000, rand() % 1000); wxBitmap btmp(1000, 1000); wxMemoryDC mdc(btmp); auto drawLinesWi...
by mael15
Fri Aug 13, 2021 9:19 am
Forum: wxCode
Topic: wxPDFDocument speed up DrawLines
Replies: 15
Views: 2990

Re: wxPDFDocument speed up DrawLines

As far as i understood, you draw a lot of lines into a wxMemoryDC, and at a bitmap size of 1039x1039 it's fast and at 1091x1091 it's slow? Yes! Did you confirm that the actual drawing takes so long? Or could it be something else. Yes, the time measured is only for the mdcPff.DrawLines(numPntsToPain...
by mael15
Fri Aug 13, 2021 8:55 am
Forum: wxCode
Topic: wxPDFDocument speed up DrawLines
Replies: 15
Views: 2990

Re: wxPDFDocument speed up DrawLines

Which wxDC do you use to draw on screen? And what is the bitmap your're talking about? Or do you mean "wxDC size"? I draw on a wxMemoryDC, would you recommend something else? Is this wxPDFDoc related at all? No, it is size related und since the pdfs I create have 300dpi, it is painted on big bitmap...