www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Best way to display images with GTKD

reply Psychological Cleanup <Help Saving.World> writes:
I have to display images with a few controls: alpha channel, 
rotation, scaling, cropping. Generally it should be png but I 
want to be able to handle many images. The images will be memory 
based(I'll load the file in to memory then) and will be displayed 
in a drawing area.

Any ideas how to go about this correctly?
Sep 30 2017
parent Mike Wey <mike-wey example.com> writes:
On 01-10-17 01:56, Psychological Cleanup wrote:
 I have to display images with a few controls: alpha channel, rotation, 
 scaling, cropping. Generally it should be png but I want to be able to 
 handle many images. The images will be memory based(I'll load the file 
 in to memory then) and will be displayed in a drawing area.
 
 Any ideas how to go about this correctly?
For displaying an image you can use gtk.Image. Rotating, scaling and cropping should be doable by loading the image into a cairo surface and then applying the transformations. But that doesn't support things like changing the alpha channel. -- Mike Wey
Oct 01 2017