Project

General

Profile

Support #3454

Wt::WPainter draw images which in memory as char array

Added by Anonymous about 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Urgent
Assignee:
Target version:
-
Start date:
07/10/2014
Due date:
% Done:

0%

Estimated time:

Description

I want to use Wt::Wpainter (

element) to draw a image which in memory as char array.

However, Wpainter only have the method "drawImage (const WRectF &rect, const Image &image)", and the Class Image only have the std::string format arguments, "Image (const std::string &url, int width, int height)".

So, How to paint the image which is in memory ,but not in local disk.

AFAIK, the char array can be converted to Wt::WImage, but, it is corresponding to element, which is slower loading many large images.

So, Is any tips and tricks to use Wt::painter to draw image in memory? Thanks!

#1

Updated by Koen Deforche over 6 years ago

  • Status changed from New to Resolved
  • Assignee set to Koen Deforche

You need to use WMemoryResource, and pass it's url() to the Image() constructor.

#2

Updated by Koen Deforche over 6 years ago

  • Tracker changed from Feature to Support
#3

Updated by Koen Deforche over 6 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF