Search found 368 matches

by mael15
Thu Aug 01, 2019 2:11 pm
Forum: wxCode
Topic: draw rotated bitmap with wxGCDC
Replies: 17
Views: 507

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: 507

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: 507

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: 507

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: 507

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: 507

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: 507

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: 507

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...
by mael15
Fri Jul 19, 2019 3:19 pm
Forum: wxCode
Topic: draw rotated bitmap with wxGCDC
Replies: 17
Views: 507

draw rotated bitmap with wxGCDC

Hi,
I fail to be able to use wxGCDC with a wxPdfDC.
When painting to the screen I use

Code: Select all

wxBufferedPaintDC dc(this);
wxGCDC gcdc(dc);
and can rotate the wxGCDC as i wish. But the wxPdfDC cannot be used with wxGCDC.
How can I draw using a rotated wxDC?
by mael15
Fri Jul 12, 2019 1:47 pm
Forum: C++ Development
Topic: show/hide controls in wxScrolledWindow
Replies: 3
Views: 77

Re: show/hide controls in wxScrolledWindow

Yes it does! Can I trigger this somehow?
by mael15
Fri Jul 12, 2019 12:14 pm
Forum: C++ Development
Topic: show/hide controls in wxScrolledWindow
Replies: 3
Views: 77

show/hide controls in wxScrolledWindow

Very weird problem, hard to describe... the sizer of a wxScrolledWindow contains a LOT of controls that are grouped in their own subsizers. I Hide() and Show() these subsizers according to what controls should be shown. Now, the bigger of two sizers is only painted as big as the smaller one is. What...
by mael15
Sat Jul 06, 2019 10:44 am
Forum: C++ Development
Topic: thread crashes in wxGDIPlusContext::DrawLines
Replies: 12
Views: 203

Re: thread crashes in wxGDIPlusContext::DrawLines

Problem solved by using good old wxMemoryDC instead of wxGraphicsContext. Thanx for your thoughts, they helped me figuring it out!
by mael15
Fri Jul 05, 2019 11:55 am
Forum: C++ Development
Topic: thread crashes in wxGDIPlusContext::DrawLines
Replies: 12
Views: 203

Re: thread crashes in wxGDIPlusContext::DrawLines

I cannot remember needing anti-alias, so I will try drawing without wxGraphicsContext, also try the 2DRenderer you mentioned.
One big difference is using wxPoint in the "normal" drawing and wxPoint2DDouble in the problematic one.
by mael15
Fri Jul 05, 2019 8:45 am
Forum: C++ Development
Topic: thread crashes in wxGDIPlusContext::DrawLines
Replies: 12
Views: 203

Re: thread crashes in wxGDIPlusContext::DrawLines

Thank you for your feedback! Apparently you were using the default GDIPlus backend. Try the Direct2D one. Maybe it's faster. -> wxGraphicsRenderer::GetDirect2DRenderer() I could not find this, could you post a link to the documentation please? I actually do not remember why I used a wxGraphicsContex...
by mael15
Thu Jul 04, 2019 4:27 pm
Forum: C++ Development
Topic: thread crashes in wxGDIPlusContext::DrawLines
Replies: 12
Views: 203

Re: thread crashes in wxGDIPlusContext::DrawLines

i have watched the windows 10 ressource monitor, it seems to freeze when when the amount of "zugesichert" ram exceeds about 60000 kB. does that make sense?!

EDIT: when i wrote this the drawing finished after one minute, so it probably is not a freeze but a very slow drawing.