Pre loader

I want to use code to intercept a picture, but find that the image is empty, how can I get the image of suface

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

I want to use code to intercept a picture, but find that the image is empty

    surface.buildDrawingCache();
    Bitmap src = surface.getDrawingCache();//save screenshot
    ((ImageView)findViewById(R.id.iv)).setImageBitmap(src);

how can I get the image of suface。

Version
2.0.0.1884
Attachments
  • You must to post comments
0
0

Hi Huang,

By default SciChartSurface uses GlSurfaceView based RenderSurface implementation which allows to use OpenGL for drawing of chart. But there is one side effect – in this case chart isn’t draws as part of Android View hierarchy so you can’t use drawing cache.

To workaround this limiation we’ve added exportToBitmap() method for SciChartSurface which allows to render chart to a Bitmap:

imageView.setImageBitmap(surface.exportToBitmap());

Hope this will help you!

Best regards,
Yura

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies