ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Drawarea offers an outPNG2 in-memory functionality, any "in-memory" LoadPNG ?
Posted by Danieldeparis on Jun-04-2019 16:33
Hi Peter,

We are progressing a lot on our DRAWAREA-based  functionality enhancements to our chart-generation routines. That includes imposing arbitrary image content - raster one, mostly png - onto our CD plots. Great!

We load this content with load instructions and are however missing a way to "feed" the additional drawarea objects directly from a memory string.

There is a great outPNG2 functionality and we use it extensively.  Is there a way - documented or not - to feed bitmap content (jpeg, png...) into a newly created drawarea?

That would be a great addition and we could get rid of some awkward on-the-fly temp resources generation (and clean-up) and possibly avoid it all!

Kind regards for the superb API:-)

Daniel

  Re: Drawarea offers an outPNG2 in-memory functionality, any "in-memory" LoadPNG ?
Posted by Danieldeparis on Jun-04-2019 16:44
Hi Peter,

I have just read this great forum content on similar questions. Yes there is some. Let me make a short addition to the previous post for clarification.

We are using the COM-based version from a VB6-like environment with limited memory-constructs available for interactions, basically base datatypes and plain arrays for COM-interaction with CD.

I understand there is a solution for C++ and C# interactions. But images as raw pixels (as an array of integers, representing the colors in the bitmap) may not be a practical solution. I did not run any test by the way and am here looking for a much more familiar string-based interaction within the CD API.

Thanks again for your great feedback here on the forum.

Daniel

  Re: Drawarea offers an outPNG2 in-memory functionality, any "in-memory" LoadPNG ?
Posted by Peter Kwan on Jun-05-2019 05:09
Hi Danieldeparis,

Unluckily, at the moment, the "in-memory" loadPNG is only available in C++ and .NET. For those editions of ChartDirector, you can just use a block of memory as if it is a file. Unluckily, this feature is not available for VB6, so you would still need to use temporary files.

Regards
Peter Kwan

  Re: Drawarea offers an outPNG2 in-memory functionality, any "in-memory" LoadPNG ?
Posted by Danieldeparis on Jun-05-2019 13:55
Hi Peter,

Hi Danieldeparis,

Unluckily, at the moment, the "in-memory" loadPNG is only available in C++ and .NET. For those editions of ChartDirector, you can just use a block of memory as if it is a file. Unluckily, this feature is not available for VB6, so you would still need to use temporary files.

Regards
Peter Kwan

Thanks for your fast answer.  We'll have resort to temp files for the moment!

Do you reckon whether I could investigate some of my spare time for a way to convert this arbitrary raster content (png and jpeg) to byte arrays (ARGB integers) via GDIPLUS calls?  Should that works - moving this raster file content to arrays of ARGB integer bytes, can I expect these plain arrays to feed the beast i-e the drawarea object using "patterncolor" or is it not even worth trying?

Thanks for the good work on CD. Always a joy to work with:-)

Daniel

  Re: Drawarea offers an outPNG2 in-memory functionality, any "in-memory" LoadPNG ?
Posted by Peter Kwan on Jun-05-2019 16:54
Hi Danieldeparis,

I think the temporary file method is fast enough. Furthermore, it is likely we will port the "use memory block as a file" feature to "ChartDirector for ASP/COM/VB" (the one used for VB6) in the future, so I would not suggest to write additional code in order to use the "change to array of colors" method.

Regards
Peter Kwan

  Re: Drawarea offers an outPNG2 in-memory functionality, any "in-memory" LoadPNG ?
Posted by Danieldeparis on Jun-05-2019 18:40
Peter Kwan wrote:

it is likely we will port the "use memory block as a file" feature to "ChartDirector for ASP/COM/VB" (the one used for VB6).


Thanks for the feedback. This is definitely great news. We'll rest on temporary files for the time being.

We are indeed massaging the CD API extensively including defining our own set of mouse interactions, embedding charts within multiple recursive levels of "multicharts",  and a lot more. CD proved extremely robust. I'm glad to hear that you may add feature later. Great.

Warm regards, Daniel