|
DrawArea.load |
Posted by Drazana on Sep-15-2016 21:34 |
|
Hello,
Is it possible to load an 32-bit color image into the current DrawArea.
Thank you,
Drazana |
Re: DrawArea.load |
Posted by Peter Kwan on Sep-16-2016 01:30 |
|
Hi Drazana,
Yes. You can use DrawArea.load to load a 32-bit PNG file into the DrawArea. The content of the DrawArea will then be replaced by the 32-bit image.
Another method is to create a patternColor using an array of 32-bit integers as the pixel colors, or create a patternColor by loading the pattern from an image file. You can then use the pattern to paint a rectangle (using DrawArea.rect).
See:
http://www.advsofteng.com/doc/cdcpp.htm#DrawArea.patternColor.htm
http://www.advsofteng.com/doc/cdcpp.htm#DrawArea.patternColor2.htm
Yet another method is to paint the image to the DrawArea using the CDML <*img*> tag.
Hope this can help.
Regards
Peter Kwan |
Re: DrawArea.load |
Posted by Drazana on Sep-16-2016 17:01 |
|
Hi Peter,
Thanks for your fast answer.
Does it works only with 32-bit PNG file format?
We are using DrawArea.load to load JPG files into the DrawArea.
This method works with 24-bit JPG files, but with 32-bit files doesn't appear to work.
Regards
Drazana |
Re: DrawArea.load |
Posted by Peter Kwan on Sep-17-2016 02:40 |
|
Hi Drazana,
By 32-bit color image, do you mean each color channel is 32-bit (so the RGB will add up to 96 bits), or do you mean there are 4 color channels each with 8 bit (like in a common ARGB image), for a total of 32 bit per pixel?
ChartDirector only supports images with 4 color channels for ARGB (Alpha, Red, Green and Blue). For JPG, normally there are only 3 color channels for RGB with 8-bit each, for a total of 24 bits per pixel. All of the JPG files I can find in the Internet appears to be 24-bit JPG. I am unable to find any 32-bit JPG.
If you have a 32-bit JPG, is it possible to email it to me for testing? My email is pkwan@advsofteng.net
Regards
Peter Kwan |
|