Search found 13 matches

by bluesnowball18
Sat Jun 19, 2021 11:11 pm
Forum: C++ Development
Topic: A general approach for using wxBitmap with wxImage
Replies: 1
Views: 1301

A general approach for using wxBitmap with wxImage

I would like to clarify one thing about the usage of wxImage. The latest trunk documentation says that By splitting the responsibilities between wxImage/wxBitmap like this then it's easier to use generic code shared by all platforms and image types for generic operations and platform specific code w...
by bluesnowball18
Wed Jun 16, 2021 5:56 pm
Forum: Platform Related Issues
Topic: wxScrolled display issues on wxGTK
Replies: 7
Views: 4197

Re: wxScrolled display issues on wxGTK

After some testing I finally found a solution. You need to set wxALWAYS_SHOW_SB window style to make it handle scrolling correctly under LXQt and probably set GTK_OVERLAY_SCROLLING environment variable to 0 on the other Linux desktop environments to make this style work. #include "wx/wxprec.h" #ifnd...
by bluesnowball18
Mon Jun 14, 2021 11:23 pm
Forum: Platform Related Issues
Topic: wxScrolled display issues on wxGTK
Replies: 7
Views: 4197

Re: wxScrolled display issues on wxGTK

Hello. I'm using Papirus icon theme. I've made an example of GtkScrolledWindow (which wxWidgets uses in GTK wxScrolled implementation) and it works fine: #include <gtk/gtk.h> void activate(GtkApplication *app, gpointer user_data) { GtkWidget *window = gtk_application_window_new(app); gtk_window_set_...
by bluesnowball18
Mon Jun 14, 2021 7:48 pm
Forum: Platform Related Issues
Topic: wxScrolled display issues on wxGTK
Replies: 7
Views: 4197

Re: wxScrolled display issues on wxGTK

The bug still appears in the scrolled sample even after installing and setting iBus as the default input method. I'll probably test it on the other Linux distros because LXQt may cause the problem.
by bluesnowball18
Sun Jun 13, 2021 10:01 pm
Forum: Platform Related Issues
Topic: wxScrolled display issues on wxGTK
Replies: 7
Views: 4197

Re: wxScrolled display issues on wxGTK

It just compiles and runs without any warnings. What's interesting is that pure wxWindow with both scrollbars enabled looks correct and doesn't flicker: #include "Canvas.hpp" #ifndef WX_PRECOMP #include "wx/dcbuffer.h" #endif wxBEGIN_EVENT_TABLE(Canvas, wxWindow) EVT_PAINT(Canvas::OnPaint) wxEND_EVE...
by bluesnowball18
Sun Jun 13, 2021 9:28 am
Forum: Platform Related Issues
Topic: wxScrolled display issues on wxGTK
Replies: 7
Views: 4197

wxScrolled display issues on wxGTK

On GTK+3, scrolled windows have two following issues: 1. The scrollbars don't scroll up to the end leaving some space; 2. The whole window flickers if any OnDraw or paint callback is present (which is I guess stemmed from window contents being repainted over the scrollbars). Here is a demonstration ...
by bluesnowball18
Sun May 09, 2021 11:02 pm
Forum: C++ Development
Topic: Set the color of .xbm stipple brush
Replies: 3
Views: 752

Re: Set the color of .xbm stipple brush

Thank you for the answer. As you suggest, I've looked at wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE and made this code snippet: #include "wx/wxprec.h" #ifndef WX_PRECOMP #include "wx/app.h" #include "wx/bitmap.h" #include "wx/frame.h" #include "wx/dcbuffer.h" #endif #include "checker.xbm" class Frame : public...
by bluesnowball18
Sun May 09, 2021 5:48 am
Forum: C++ Development
Topic: Set the color of .xbm stipple brush
Replies: 3
Views: 752

Set the color of .xbm stipple brush

I wrote a small program which displays checker pattern using .xbm stipple image: wxBrush brush(stipple); wxAutoBufferedPaintDC dc(this); dc.SetBrush(brush); dc.SetPen(*wxTRANSPARENT_PEN); dc.Clear(); dc.DrawRectangle(8, 8, 64, 64); Here is what it shows on MSW and GTK+3: https://i.imgur.com/FxU5m9d....
by bluesnowball18
Mon May 03, 2021 10:43 pm
Forum: C++ Development
Topic: Scroll to an arbitrary position
Replies: 0
Views: 4617

Scroll to an arbitrary position

I have wxScrolled container with the scroll rate greater than 1. My question is, how can I set wxScrolled viewport starting point to an arbitrary position in pixels, not in scroll units? wxWindow::ScrollWindow doesn't work with wxScrolled, or maybe I'm using it wrong: Canvas::Canvas(wxWindow *parent...
by bluesnowball18
Tue Apr 27, 2021 10:22 pm
Forum: C++ Development
Topic: Clear or erase wxBitmap
Replies: 5
Views: 1167

Re: Clear or erase wxBitmap

I think I've found a solution. Thank you for the responses.

Code: Select all

wxImage image("image.jpeg");
image.InitAlpha();

this->bitmap = wxBitmap(image);

Code: Select all

wxMemoryDC dc(this->bitmap);

dc.SetLogicalFunction(wxCLEAR);
dc.DrawRectangle(100, 100, 40, 20);
by bluesnowball18
Tue Apr 27, 2021 2:43 pm
Forum: C++ Development
Topic: Clear or erase wxBitmap
Replies: 5
Views: 1167

Re: Clear or erase wxBitmap

It can have any size up to 4096*4096 pixels.
by bluesnowball18
Tue Apr 27, 2021 10:59 am
Forum: C++ Development
Topic: Clear or erase wxBitmap
Replies: 5
Views: 1167

Clear or erase wxBitmap

Is there an easy way to fill a rectangular area of wxBitmap or entire bitmap with transparent color?
by bluesnowball18
Thu Apr 22, 2021 11:39 am
Forum: C++ Development
Topic: Best way to draw non-antialiased image with alpha support?
Replies: 2
Views: 786

Best way to draw non-antialiased image with alpha support?

Hello all. I have a control derived from wxWindow with EVT_PAINT callback. I want to display an image according to the following requirements: It should support alpha channel on all platforms (at least on MSW, GTK+ and OSX wxWidgets builds); The image should be resized with nearest neighbor interpol...