gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat
-rw-r--r--fox-gui/fx_plot_canvas.cpp 26
-rw-r--r--fox-gui/fx_plot_canvas.h 1
2 files changed, 27 insertions, 0 deletions
diff --git a/fox-gui/fx_plot_canvas.cpp b/fox-gui/fx_plot_canvas.cpp
index 595ff2eb..a6a0c90f 100644
--- a/fox-gui/fx_plot_canvas.cpp
+++ b/fox-gui/fx_plot_canvas.cpp
@@ -70,6 +70,32 @@ void fx_plot_canvas::draw(FXEvent* event)
m_dirty_flag = false;
}
+void fx_plot_canvas::update_region(const FXRectangle& r)
+{
+ if (!m_canvas || !m_plot)
+ return;
+
+ FXImage img(getApp(), NULL, IMAGE_OWNED|IMAGE_SHMI|IMAGE_SHMP, r.w, r.h);
+
+ const unsigned bpp = 32;
+ const unsigned pixel_size = bpp / 8;
+
+ agg::rendering_buffer dest;
+ dest.attach((agg::int8u*) img.getData(), r.w, r.h, -r.w * pixel_size);
+
+ agg::int8u* dd = m_rbuf.row_ptr(r.y) + r.x * pixel_size;
+ // m_img_data + (m_img_width * (m_img_height - r.y - 1) + r.x) * pixel_size;
+ agg::rendering_buffer src;
+ src.attach(dd, r.w, r.h, m_rbuf.stride());
+
+ dest.copy_from(src);
+
+ img.create();
+
+ FXDCWindow dc(this);
+ dc.drawImage(&img, r.x, r.y);
+}
+
void fx_plot_canvas::attach(plot_type* p)
{
m_plot = p;
diff --git a/fox-gui/fx_plot_canvas.h b/fox-gui/fx_plot_canvas.h
index 60c0ff40..fcbd787a 100644
--- a/fox-gui/fx_plot_canvas.h
+++ b/fox-gui/fx_plot_canvas.h
@@ -22,6 +22,7 @@ public:
void attach(plot_type* p);
void draw(FXEvent* event);
+ void update_region(const FXRectangle& r);
long on_cmd_paint(FXObject *, FXSelector, void *);
long on_update(FXObject *, FXSelector, void *);
generated by cgit v1.2.3 (git 2.25.1) at 2025年09月17日 03:35:40 +0000

AltStyle によって変換されたページ (->オリジナル) /