Search found 134 matches

by dkaip
Fri May 18, 2018 12:33 pm
Forum: C++ Development
Topic: Strange behaviour in DC [SOLVED]
Replies: 27
Views: 441

Re: Strange behaviour in DC [SOLVED]

Thank's doublemax. Finally the reason is that must not have wxStaticImage control. void BasicDrawPane::render(wxDC& dc) { wxBitmap bmp("5.png"); wxImage img=bmp.ConvertToImage(); int w = int(bmp.GetWidth() * 0.5); int h = int(bmp.GetHeight() * 0.5); wxImage scaled =img.Scale(w,h,wxIMAG...
by dkaip
Fri May 18, 2018 11:36 am
Forum: C++ Development
Topic: Strange behaviour in DC [SOLVED]
Replies: 27
Views: 441

Re: Strange behaviour in DC [SOLVED]

In test program bellow from wiki page in a DC draw shapes. But if i put an image with code ... BasicDrawPane::BasicDrawPane(wxFrame* parent) : wxPanel(parent) { bitmap = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap,wxDefaultPosition, wxDefaultSize, 0 ); wxBitmap bmp("005.png"); wxImage...
by dkaip
Wed May 16, 2018 7:03 pm
Forum: C++ Development
Topic: Strange behaviour in DC [SOLVED]
Replies: 27
Views: 441

Re: Strange behaviour in DC [SOLVED]

This is not a program it is just a test to know how to draw these lines over a bitmap.
As you see first construct is bitmap and second the lines. Maybe must work with mask dc, but how?
by dkaip
Wed May 16, 2018 10:59 am
Forum: C++ Development
Topic: Strange behaviour in DC [SOLVED]
Replies: 27
Views: 441

Re: Strange behaviour in DC [SOLVED]

Hello. I mean as you can see in picture, the lines do not go through image. wxBitmap orig_bitmap=wxBitmap("005.png"); wxImage orig_image=orig_bitmap.ConvertToImage(); int new_w = int(orig_image.GetWidth() * 0.5); int new_h = int(orig_image.GetHeight() * 0.5); wxImage scaled =orig_image.Sca...
by dkaip
Sun May 13, 2018 11:17 pm
Forum: C++ Development
Topic: Strange behaviour in DC [SOLVED]
Replies: 27
Views: 441

Re: Strange behaviour in DC [SOLVED]

PB thank's very much. Very good explanation and now i understand how i must design.
Putting a bitmap as background, i must over it to design shape.
My line goes under bitmap. Any help most welcome.
Thank's again.
Jim
by dkaip
Sat May 12, 2018 4:14 am
Forum: C++ Development
Topic: Strange behaviour in DC [SOLVED]
Replies: 27
Views: 441

Re: Strange behaviour in DC [SOLVED]

PB your code work just fine. But my problem in drawing in a dc is that i dont know how to draw a line before any other processes. For example if change OnClearDrawing like this a line appears if push the button. void OnClearDrawing(wxCommandEvent&) { m_canvas->ClearDrawing(); wxPaintDC dc(m_canv...
by dkaip
Thu May 10, 2018 4:23 pm
Forum: C++ Development
Topic: Strange behaviour in DC [SOLVED]
Replies: 27
Views: 441

Re: Strange behaviour in DC [SOLVED]

I try it. No response from OnMouseCaptureLost. m_bitmap1->Bind(wxEVT_MOUSE_CAPTURE_LOST, &ImageDialog::OnMouseCaptureLost, this); void ImageDialog::OnMouseCaptureLost( wxMouseCaptureLostEvent& event ) { wxMessageBox("Mouse Capture Lost"); dragging = false; event.Skip(); }
by dkaip
Thu May 10, 2018 4:14 pm
Forum: C++ Development
Topic: Strange behaviour in DC [SOLVED]
Replies: 27
Views: 441

Re: Strange behaviour in DC [SOLVED]

Ok thank's. As you can see i have modal dialog, class Image derive from wxDialog. Code is simple. Because i must have modal dialog over another modal dialog, ImageDialog stops an in shut-down says .. ../src/common/wincmn.cpp(3346): assert "Assert failure" failed in DoNotifyWindowAboutCaptu...
by dkaip
Thu May 10, 2018 3:08 pm
Forum: C++ Development
Topic: Strange behaviour in DC [SOLVED]
Replies: 27
Views: 441

Re: Strange behaviour in DC [SOLVED]

All that i am trying but no call OnMouseCaptureLost. BEGIN_EVENT_TABLE(ImageDialog, Image) EVT_MOUSE_CAPTURE_LOST(ImageDialog::OnMouseCaptureLost) // DONT WORKS END_EVENT_TABLE() and with Bind(wxEVT_MOUSE_CAPTURE_LOST, &ImageDialog::OnMouseCaptureLost, this); // DONT WORKS ... void ImageDialog::...
by dkaip
Thu May 10, 2018 2:29 pm
Forum: C++ Development
Topic: Strange behaviour in DC [SOLVED]
Replies: 27
Views: 441

Re: Strange behaviour in DC [SOLVED]

Sorry, a wrong input.. . wxImage image is in ImageDialog.. But in wxStaticBitmap mouse events have not EVT_MOUSE_CAPTURE_LOST, only i must do something i suppose in OnMouseEvents as you can see in wxFormBuilder. class Image : public wxDialog { private: protected: wxStaticBitmap* m_bitmap1; // Virtua...
by dkaip
Thu May 10, 2018 12:22 pm
Forum: C++ Development
Topic: Strange behaviour in DC [SOLVED]
Replies: 27
Views: 441

Re: Strange behaviour in DC [SOLVED]

I am trying an ImageDialog from image from wxDialog so in the m_staticText1 PaintDC i will have draw lines etc. I must have the EVT_MOUSE_CAPTURE_LOST event, but don't works neither EVT_MOUSE_CAPTURE_LOST(ImageDialog:: .. neither Bind(wxEVT_MOUSE_CAPTURE_LOST ... I can not know how to to take effect...
by dkaip
Mon May 07, 2018 9:25 pm
Forum: C++ Development
Topic: Strange behaviour in DC [SOLVED]
Replies: 27
Views: 441

Re: Strange behaviour in DC [SOLVED]

Oh i have wxWidgets-3.0.3. Taking from there drawing runs ok.
Thank's i will study your example.
Jim
by dkaip
Mon May 07, 2018 8:40 pm
Forum: C++ Development
Topic: Strange behaviour in DC [SOLVED]
Replies: 27
Views: 441

Re: Strange behaviour in DC [SOLVED]

Thank you very much. I am trying the wxWidgets/samples/drawing/drawing.cpp file. Compiling says at line 148 (return m_renderer->GetName() == name;) that there is not method GetName in class wxGraphicsRenderer, and at http://docs.wxwidgets.org/3.0.4/classwx_graphics_renderer.html i can not find any m...
by dkaip
Mon May 07, 2018 3:16 pm
Forum: C++ Development
Topic: Strange behaviour in DC [SOLVED]
Replies: 27
Views: 441

Re: Strange behaviour in DC [SOLVED]

Have some url fo some basic drawing tutorials?
Thank's
Jim
by dkaip
Mon May 07, 2018 8:42 am
Forum: C++ Development
Topic: Strange behaviour in DC [SOLVED]
Replies: 27
Views: 441

Strange behaviour in DC [SOLVED]

After image zoom i can see the line. But after exit from UpdateBitmap() function line disappear. But i don’t understand why. class ImageControl : public wxFrame --------- private: wxDC* frameDC; ImageViewer *m_viewer; ----------- void ImageControl::OnZoomOut(wxCommandEvent& event) { event.Skip(t...

Go to advanced search