Project

General

Profile

Actions

Support #3454

closed

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

Added by Anonymous almost 10 years ago. Updated about 9 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!

Actions #1

Updated by Koen Deforche about 9 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.

Actions #2

Updated by Koen Deforche about 9 years ago

  • Tracker changed from Feature to Support
Actions #3

Updated by Koen Deforche about 9 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF