how to simulate the image layer , like the one in Photoshop

Status
Not open for further replies.

pavilion

Broken In
I try to write my own Paint program , and I wonder how to create the "layer system" , like Photoshop , Paint.NET 's features , I try to draw multiple stacked images on form , but it just works terribly .
Anyone got an idea of how to do it ? Just an idea , don't give me the source code ,ok . Thanks ^^
 

QwertyManiac

Commander in Chief
What graphics library are you using? If it supports alpha channels why not just draw the layers one over another using it? Layers are much like an undo stack otherwise. Each new action needs to be drawn and every change in the stack prompts a redraw.

There are things known (in Qt) as Composition modes. Based on how the layers are to be ordered, you set the composition modes appropriately and draw the stack over the destination image area. The QPainter class does this very well.

You can see an example here: *doc.trolltech.com/qq/qq17-compositionmodes.html

I don't know the low level implementation of this, if thats what you are asking.
 
Status
Not open for further replies.
Top Bottom