Hi, Finally I got some time to look at this.
You used a CD_IMAGE driver to implement the third buffer. It is ok, but you miss drawing that image on the main canvas. Simply calling flush for that canvas does nothing because it is just a canvas that draws on an image, it does not know that the image must be transferred to another canvas. So, we can solve that in two ways. First you can simply draw the cdImage into the cdbCanvas by calling "cdbCanvas:PutImageRect(cdImage, 0, 0 , 0, 0 , 0, 0)" instead of "cdbbCanvas:Flush()". But when the dialog is resized the image must be recreated so the CD_IMAGE driver. Or you can use the CD_DBUFFER driver that will do all that for you, and the image will be hidden inside the canvas. I attached the two modified samples to illustrates the two solutions. Best, Scuri Em qua., 26 de fev. de 2020 às 20:01, Antonio Scuri <antonio.sc...@gmail.com> escreveu: > Hi, > > I will tomorrow. > > Best, > Scuri > > > Em qua, 26 de fev de 2020 19:55, Milind Gupta <milind.gu...@gmail.com> > escreveu: > >> Hi Antonio, >> If you can have a look at my example and suggest me modifications >> that would be very helpful. >> >> Thanks, >> Milind >> >> On Fri, Feb 7, 2020, 11:05 AM Milind Gupta <milind.gu...@gmail.com> >> wrote: >> >>> Hi Antonio, >>> If you can have a look at my example and suggest me modifications >>> that would be very helpful. >>> >>> Thanks, >>> Milind >>> >>> On Fri, Jan 31, 2020 at 12:36 PM Milind Gupta <milind.gu...@gmail.com> >>> wrote: >>> >>>> No problem, enjoy your vacation. Just attaching here another try I did, >>>> improving it as my understanding. >>>> >>>> Thanks, >>>> Milind >>>> >>>> On Fri, Jan 31, 2020 at 7:06 AM Antonio Scuri <antonio.sc...@gmail.com> >>>> wrote: >>>> >>>>> Hi, >>>>> >>>>> I'm on vacation during this week. I'll answer as soon as I have some >>>>> time. >>>>> >>>>> Best, >>>>> Scuri >>>>> >>>>> >>>>> Em sex, 31 de jan de 2020 02:34, Milind Gupta <milind.gu...@gmail.com> >>>>> escreveu: >>>>> >>>>>> Hi Antonio, >>>>>> I am a little lost on how to set this up. I have the >>>>>> following script where I am trying to make a cdImage where I will put the >>>>>> drawing which does not change and then I want to use cdbCanvas to draw >>>>>> changes. I am not able to figure out how to use cdImage as a buffer for >>>>>> cdbCanvas. >>>>>> >>>>>> What I expect from the script is when I start it, it should show me >>>>>> the blue lines already from cdImage. Once I press the button then I >>>>>> should >>>>>> see additional drawing that was drawn on cdbCanvas. >>>>>> >>>>>> On Sat, Jan 25, 2020 at 3:02 PM Antonio Scuri < >>>>>> antonio.sc...@gmail.com> wrote: >>>>>> >>>>>>> A double buffer canvas such as CD_IUPDBUFFER is actually a CD_IUP >>>>>>> that automatically manages an image where everything is draw and this >>>>>>> image >>>>>>> is drawn in the CD_IUP canvas when flush is called. >>>>>>> >>>>>>> So, you can do any buffers you want but you will have to manually >>>>>>> manage the image using cdCanvasCreateImage and a CD_IMAGE canvas to >>>>>>> draw in >>>>>>> the image. Notice that your main canvas can still be a CD_IUPDBUFFER. >>>>>>> >>>>>>> Best, >>>>>>> Scuri >>>>>>> >>>>>>> >>>>>>> Em sex., 24 de jan. de 2020 às 19:06, Milind Gupta < >>>>>>> milind.gu...@gmail.com> escreveu: >>>>>>> >>>>>>>> Hi, >>>>>>>> Is it possible to add a buffer to a buffer canvas? If >>>>>>>> there is a part of a drawing that rarely changes it can be drawn in >>>>>>>> the 3rd >>>>>>>> canvas and flushed to the buffer canvas before doing the other changes. >>>>>>>> >>>>>>>> Milind >>>>>>>> _______________________________________________ >>>>>>>> Canvasdraw-users mailing list >>>>>>>> canvasdraw-us...@lists.sourceforge.net >>>>>>>> https://lists.sourceforge.net/lists/listinfo/canvasdraw-users >>>>>>>> >>>>>>> _______________________________________________ >>>>>>> Canvasdraw-users mailing list >>>>>>> canvasdraw-us...@lists.sourceforge.net >>>>>>> https://lists.sourceforge.net/lists/listinfo/canvasdraw-users >>>>>>> >>>>>> _______________________________________________ >>>>>> Canvasdraw-users mailing list >>>>>> canvasdraw-us...@lists.sourceforge.net >>>>>> https://lists.sourceforge.net/lists/listinfo/canvasdraw-users >>>>>> >>>>> _______________________________________________ >>>>> Canvasdraw-users mailing list >>>>> canvasdraw-us...@lists.sourceforge.net >>>>> https://lists.sourceforge.net/lists/listinfo/canvasdraw-users >>>>> >>>> _______________________________________________ >> Canvasdraw-users mailing list >> canvasdraw-us...@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/canvasdraw-users >> >
canvas_buffer1.lua
Description: Binary data
canvas_buffer2.lua
Description: Binary data
_______________________________________________ Iup-users mailing list Iup-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/iup-users