canvasdraw-users Mailing List for CD (Page 2)
Brought to you by:
scuri
You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(12) |
Nov
(1) |
Dec
|
2012 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
(4) |
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(7) |
Oct
|
Nov
(7) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
(1) |
Feb
|
Mar
|
Apr
(13) |
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(7) |
2020 |
Jan
(12) |
Feb
(3) |
Mar
(11) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Antonio S. <ant...@gm...> - 2020-01-24 21:00:13
|
Hi, It is because we use a different technique in Windows to draw lines when LineWidth=1, a cosmetic pen. Don't rely on the sizes and the alignment of the custom line styles. Although they are usually equivalent to pixels they may depend on the driver. Best, Scuri Em qui., 23 de jan. de 2020 às 17:31, Milind Gupta <mil...@gm...> escreveu: > A little more information. If I add LineWidth = 2 after setting the line > style then only it works properly. Why does LineWidth=1 not work? > > On Wed, Jan 22, 2020 at 6:09 PM Milind Gupta <mil...@gm...> > wrote: > >> Hi, >> I created a custom linestyle of 1 dot and 9 spaces. When I plot this >> line I see multiple dots and a much longer space. The attached script plots >> it as a horizontal line and creates some vertical markers below which the >> dots were expected. The dots however are not aligned to those vertical >> markers. Am I specifying the style array incorrectly? >> >> Thanks, >> Milind >> > _______________________________________________ > Canvasdraw-users mailing list > Can...@li... > https://lists.sourceforge.net/lists/listinfo/canvasdraw-users > |
From: Milind G. <mil...@gm...> - 2020-01-23 20:31:21
|
A little more information. If I add LineWidth = 2 after setting the line style then only it works properly. Why does LineWidth=1 not work? On Wed, Jan 22, 2020 at 6:09 PM Milind Gupta <mil...@gm...> wrote: > Hi, > I created a custom linestyle of 1 dot and 9 spaces. When I plot this > line I see multiple dots and a much longer space. The attached script plots > it as a horizontal line and creates some vertical markers below which the > dots were expected. The dots however are not aligned to those vertical > markers. Am I specifying the style array incorrectly? > > Thanks, > Milind > |
From: Milind G. <mil...@gm...> - 2020-01-23 02:09:27
|
Hi, I created a custom linestyle of 1 dot and 9 spaces. When I plot this line I see multiple dots and a much longer space. The attached script plots it as a horizontal line and creates some vertical markers below which the dots were expected. The dots however are not aligned to those vertical markers. Am I specifying the style array incorrectly? Thanks, Milind |
From: Milind G. <mil...@gm...> - 2020-01-23 01:37:30
|
Ok thanks for the update. The documentation on the CD may need to be updated. Best Regards, Milind On Wed, Jan 22, 2020 at 5:35 PM Antonio Scuri <ant...@gm...> wrote: > GTK migrated from GDK to Cairo. And when anti-aliasing/transparency is > available XOR is not supported. > > Our recommendation is don't use XOR anymore anywhere. Use double buffer > and redraw everything. The nowadays GPUs are fast enough for that. > > Best, > Scuri > > > Em qua., 22 de jan. de 2020 às 19:09, Milind Gupta <mil...@gm...> > escreveu: > >> Hi, >> I have a canvas on which I draw something using the CD_XOR >> writemode. The example pasted below works fine by drawing a black line on >> windows but not on linux. Linux does not show anything. >> What am I doing wrong here? >> >> Thanks, >> Milind >> _______________________________________________ >> Canvasdraw-users mailing list >> Can...@li... >> https://lists.sourceforge.net/lists/listinfo/canvasdraw-users >> > _______________________________________________ > Canvasdraw-users mailing list > Can...@li... > https://lists.sourceforge.net/lists/listinfo/canvasdraw-users > |
From: Antonio S. <ant...@gm...> - 2020-01-23 01:35:08
|
GTK migrated from GDK to Cairo. And when anti-aliasing/transparency is available XOR is not supported. Our recommendation is don't use XOR anymore anywhere. Use double buffer and redraw everything. The nowadays GPUs are fast enough for that. Best, Scuri Em qua., 22 de jan. de 2020 às 19:09, Milind Gupta <mil...@gm...> escreveu: > Hi, > I have a canvas on which I draw something using the CD_XOR > writemode. The example pasted below works fine by drawing a black line on > windows but not on linux. Linux does not show anything. > What am I doing wrong here? > > Thanks, > Milind > _______________________________________________ > Canvasdraw-users mailing list > Can...@li... > https://lists.sourceforge.net/lists/listinfo/canvasdraw-users > |
From: Milind G. <mil...@gm...> - 2020-01-22 22:09:51
|
Hi, I have a canvas on which I draw something using the CD_XOR writemode. The example pasted below works fine by drawing a black line on windows but not on linux. Linux does not show anything. What am I doing wrong here? Thanks, Milind |
From: Milind G. <mil...@gm...> - 2019-12-18 18:18:51
|
Found it. Thanks. On Wed, Dec 18, 2019 at 10:11 AM Antonio Scuri <ant...@gm...> wrote: > Hi, > > Its documentation is inside the CD_IUP driver documentation. > > Yes, it just simplifies the creation of a double buffer driver. > > Best, > Scuri > > > Em qua., 18 de dez. de 2019 às 14:28, Milind Gupta <mil...@gm...> > escreveu: > >> Hi Antonio, >> I was going through the simple paint tutorial and came across >> CD_IUPDBUFFER driver when using CD CreateCanvas. I could not find the >> documentation for it on CD page. I was initializing my IUP canvas with CD >> for double buffering in Map_CB like this: >> >> local cd_Canvas = cd.CreateCanvas(cd.IUP, iupcanvas) >> local cd_bCanvas = cd.CreateCanvas(cd.DBUFFER,cd_Canvas) >> >> I see with CD_IUPDBUFFER you don't need 2 of them. Please can you give >> some info about this driver. >> >> Thanks, >> Milind >> _______________________________________________ >> Canvasdraw-users mailing list >> Can...@li... >> https://lists.sourceforge.net/lists/listinfo/canvasdraw-users >> > _______________________________________________ > Canvasdraw-users mailing list > Can...@li... > https://lists.sourceforge.net/lists/listinfo/canvasdraw-users > |
From: Milind G. <mil...@gm...> - 2019-12-18 18:18:16
|
Got it. Thanks. On Wed, Dec 18, 2019 at 10:14 AM Antonio Scuri <ant...@gm...> wrote: > > So is there a way to figure out how the stipple is placed on the canvas > so that we know at what coordinate (and its multiples) a 1 on the stipple > ends up on? > > No, there is no way to guarantie the position of the stipple in the > canvas. > > If you need a grid, I suggest you to manually draw the grid with lines... > > Best, > Scuri > > > Em qua., 18 de dez. de 2019 às 14:59, Milind Gupta <mil...@gm...> > escreveu: > >> For an experiment I tried this script where I create a stipple to create >> a 10x10 grid on the canvas. And then I draw a rectangle from 10,10 to >> 200,200. If I use InvertYAxis transformation function my y1 and y2 >> transform to 387 and 197 (Why does it transform to this? I thought it would >> be height-y-1?) and I get the following: >> >> [image: image.png] >> If I use the transformation: height - y -2 then the rectangle aligns >> perfectly as shown below: >> [image: image.png] >> But I don't understand why doesn't height-y-1 align with it.It seems the >> stipple starts 1 pixel higher?? >> >> Milind >> >> >> On Tue, Dec 17, 2019 at 2:07 PM Milind Gupta <mil...@gm...> >> wrote: >> >>> Hi, >>> I want to create a stipple for a fill on the entire canvas in a >>> way so that I see a grid on the canvas. I want this stipple to be placed on >>> the canvas in a particular alignment so that the grid points match certain >>> coordinates. So is there a way to figure out how the stipple is placed on >>> the canvas so that we know at what coordinate (and its multiples) a 1 on >>> the stipple ends up on? >>> >>> Thanks, >>> Milind >>> >> _______________________________________________ >> Canvasdraw-users mailing list >> Can...@li... >> https://lists.sourceforge.net/lists/listinfo/canvasdraw-users >> > _______________________________________________ > Canvasdraw-users mailing list > Can...@li... > https://lists.sourceforge.net/lists/listinfo/canvasdraw-users > |
From: Antonio S. <ant...@gm...> - 2019-12-18 18:14:29
|
> So is there a way to figure out how the stipple is placed on the canvas so that we know at what coordinate (and its multiples) a 1 on the stipple ends up on? No, there is no way to guarantie the position of the stipple in the canvas. If you need a grid, I suggest you to manually draw the grid with lines... Best, Scuri Em qua., 18 de dez. de 2019 às 14:59, Milind Gupta <mil...@gm...> escreveu: > For an experiment I tried this script where I create a stipple to create a > 10x10 grid on the canvas. And then I draw a rectangle from 10,10 to > 200,200. If I use InvertYAxis transformation function my y1 and y2 > transform to 387 and 197 (Why does it transform to this? I thought it would > be height-y-1?) and I get the following: > > [image: image.png] > If I use the transformation: height - y -2 then the rectangle aligns > perfectly as shown below: > [image: image.png] > But I don't understand why doesn't height-y-1 align with it.It seems the > stipple starts 1 pixel higher?? > > Milind > > > On Tue, Dec 17, 2019 at 2:07 PM Milind Gupta <mil...@gm...> > wrote: > >> Hi, >> I want to create a stipple for a fill on the entire canvas in a >> way so that I see a grid on the canvas. I want this stipple to be placed on >> the canvas in a particular alignment so that the grid points match certain >> coordinates. So is there a way to figure out how the stipple is placed on >> the canvas so that we know at what coordinate (and its multiples) a 1 on >> the stipple ends up on? >> >> Thanks, >> Milind >> > _______________________________________________ > Canvasdraw-users mailing list > Can...@li... > https://lists.sourceforge.net/lists/listinfo/canvasdraw-users > |
From: Antonio S. <ant...@gm...> - 2019-12-18 18:11:15
|
Hi, Its documentation is inside the CD_IUP driver documentation. Yes, it just simplifies the creation of a double buffer driver. Best, Scuri Em qua., 18 de dez. de 2019 às 14:28, Milind Gupta <mil...@gm...> escreveu: > Hi Antonio, > I was going through the simple paint tutorial and came across > CD_IUPDBUFFER driver when using CD CreateCanvas. I could not find the > documentation for it on CD page. I was initializing my IUP canvas with CD > for double buffering in Map_CB like this: > > local cd_Canvas = cd.CreateCanvas(cd.IUP, iupcanvas) > local cd_bCanvas = cd.CreateCanvas(cd.DBUFFER,cd_Canvas) > > I see with CD_IUPDBUFFER you don't need 2 of them. Please can you give > some info about this driver. > > Thanks, > Milind > _______________________________________________ > Canvasdraw-users mailing list > Can...@li... > https://lists.sourceforge.net/lists/listinfo/canvasdraw-users > |
From: Milind G. <mil...@gm...> - 2019-12-18 17:59:50
|
For an experiment I tried this script where I create a stipple to create a 10x10 grid on the canvas. And then I draw a rectangle from 10,10 to 200,200. If I use InvertYAxis transformation function my y1 and y2 transform to 387 and 197 (Why does it transform to this? I thought it would be height-y-1?) and I get the following: [image: image.png] If I use the transformation: height - y -2 then the rectangle aligns perfectly as shown below: [image: image.png] But I don't understand why doesn't height-y-1 align with it.It seems the stipple starts 1 pixel higher?? Milind On Tue, Dec 17, 2019 at 2:07 PM Milind Gupta <mil...@gm...> wrote: > Hi, > I want to create a stipple for a fill on the entire canvas in a > way so that I see a grid on the canvas. I want this stipple to be placed on > the canvas in a particular alignment so that the grid points match certain > coordinates. So is there a way to figure out how the stipple is placed on > the canvas so that we know at what coordinate (and its multiples) a 1 on > the stipple ends up on? > > Thanks, > Milind > |
From: Milind G. <mil...@gm...> - 2019-12-18 17:28:21
|
Hi Antonio, I was going through the simple paint tutorial and came across CD_IUPDBUFFER driver when using CD CreateCanvas. I could not find the documentation for it on CD page. I was initializing my IUP canvas with CD for double buffering in Map_CB like this: local cd_Canvas = cd.CreateCanvas(cd.IUP, iupcanvas) local cd_bCanvas = cd.CreateCanvas(cd.DBUFFER,cd_Canvas) I see with CD_IUPDBUFFER you don't need 2 of them. Please can you give some info about this driver. Thanks, Milind |
From: Milind G. <mil...@gm...> - 2019-12-17 22:07:46
|
Hi, I want to create a stipple for a fill on the entire canvas in a way so that I see a grid on the canvas. I want this stipple to be placed on the canvas in a particular alignment so that the grid points match certain coordinates. So is there a way to figure out how the stipple is placed on the canvas so that we know at what coordinate (and its multiples) a 1 on the stipple ends up on? Thanks, Milind |
From: Matic K. <kuk...@ho...> - 2019-05-16 19:48:43
|
Hi Antonio, If you simply FILL the path without STROKE, this should eliminate the line. Excellent! I didn't know there was just CD_PATH_FILL. To use to use Windows with Styles take a look at: Right, I forgot about that! Thanks, Matic ________________________________ From: Antonio Scuri <ant...@gm...> Sent: Thursday, May 16, 2019 3:46 PM To: CD discussion list. Subject: Re: [Canvasdraw-users] Canvas edge line Hi, cdCanvasLineWidth(0) will not hide the line. It is actually invalid and ignored. If you simply FILL the path without STROKE, this should eliminate the line. To use to use Windows with Styles take a look at: http://webserver2.tecgraf.puc-rio.br/iup/en/drv/win32.html Best, Scuri Em qua, 15 de mai de 2019 às 20:54, Matic Kukovec <kuk...@ho...<mailto:kuk...@ho...>> escreveu: Hey Antonio, I have a canvas that works great, which I draw using two triangle paths by using cdCanvasPathSet and specifiying all the vertexes. But the edge of the canvas path is white, which is the foreground and background color, but I have set the cdCanvasLineWidth(0). The canvas height and width are used for the edge points of the path. Here is the canvas (the white edge is marked with the red arrow): [cid:16ac0dcb19bcb971f161] Is there a way to remove this edge? The second question is: the IupVal on the right is in the Window classic style, how do I change it to use Windows with Styles? Thanks, Matic _______________________________________________ Canvasdraw-users mailing list Can...@li...<mailto:Can...@li...> https://lists.sourceforge.net/lists/listinfo/canvasdraw-users |
From: Antonio S. <ant...@gm...> - 2019-05-16 13:46:23
|
Hi, cdCanvasLineWidth(0) will not hide the line. It is actually invalid and ignored. If you simply FILL the path without STROKE, this should eliminate the line. To use to use Windows with Styles take a look at: http://webserver2.tecgraf.puc-rio.br/iup/en/drv/win32.html Best, Scuri Em qua, 15 de mai de 2019 às 20:54, Matic Kukovec <kuk...@ho...> escreveu: > Hey Antonio, > > I have a canvas that works great, which I draw using two triangle paths by > using *cdCanvasPathSet *and specifiying all the vertexes. > But the edge of the canvas path is white, which is the foreground and > background color, but I have set the *cdCanvasLineWidth(0)*. > The canvas height and width are used for the edge points of the path. > Here is the canvas (the white edge is marked with the red arrow): > Is there a way to remove this edge? > > The second question is: the IupVal on the right is in the Window classic > style, how do I change it to use Windows with Styles? > > Thanks, > Matic > _______________________________________________ > Canvasdraw-users mailing list > Can...@li... > https://lists.sourceforge.net/lists/listinfo/canvasdraw-users > |
From: Matic K. <kuk...@ho...> - 2019-05-15 23:54:03
|
Hey Antonio, I have a canvas that works great, which I draw using two triangle paths by using cdCanvasPathSet and specifiying all the vertexes. But the edge of the canvas path is white, which is the foreground and background color, but I have set the cdCanvasLineWidth(0). The canvas height and width are used for the edge points of the path. Here is the canvas (the white edge is marked with the red arrow): [cid:1dd996aa-b488-4f89-a1bc-53cbe6818ddc] Is there a way to remove this edge? The second question is: the IupVal on the right is in the Window classic style, how do I change it to use Windows with Styles? Thanks, Matic |
From: Matic K. <kuk...@ho...> - 2019-04-13 21:20:12
|
Right, exactly. It's C after all. It works now. Thanks Antonio! Matic ________________________________ From: Antonio Scuri <ant...@gm...> Sent: Saturday, April 13, 2019 9:15 PM To: CD discussion list. Subject: Re: [Canvasdraw-users] Get pixel RGB information? Yes, you are missing... You have to allocate memory for those pointers. malloc(w * h) For each one. Use cdCanvasGetSize instead of an IUP attribute. It will be more coherent and avoid native borders that are not computed in the canvas drawing area. Best, Scuri Em sáb, 13 de abr de 2019 16:11, Matic Kukovec <kuk...@ho...<mailto:kuk...@ho...>> escreveu: Hi Antonio, Thanks for the hint. I'm trying to use the cdCanvasGetImageRGB function, but it throws a segmentation fault. I'm using this: cdCanvas* cd_canvas = (cdCanvas*)IupGetAttribute(iup_canvas, "cdCanvas"); int ch, cw; IupGetIntInt(iup_canvas, &ch, &cw); unsigned char* r, g, b; cdCanvasGetImageRGB(cd_canvas, r, g, b, 0, 0, cw, ch); // Throws a segfault! The last line throws a segfault if cw and ch are anything except 0, 0. But the r, g and b are all null. I'm probably missing something, any ideas? Matic ________________________________ From: Antonio Scuri <ant...@gm...<mailto:ant...@gm...>> Sent: Saturday, April 13, 2019 8:15 PM To: CD discussion list. Subject: Re: [Canvasdraw-users] Get pixel RGB information? No. Actually almost all graphics libraries do not have pixel access anymore. In CD there are two ways, you can use cdCanvasGetImageRGB to retreive an image of the canvas, then inspect its pixels. Or use the CD_IMAGERGB driver where you are drawing in an image where you can access its buffer. Best, Scuri Em sáb, 13 de abr de 2019 às 15:05, Matic Kukovec <kuk...@ho...<mailto:kuk...@ho...>> escreveu: Hi, Is there a way to get RGB color information of a specific pixel on a canvas? Maybe something like cdCanvasGetImageRGB but for the canvas? Thanks, Matic _______________________________________________ Canvasdraw-users mailing list Can...@li...<mailto:Can...@li...> https://lists.sourceforge.net/lists/listinfo/canvasdraw-users _______________________________________________ Canvasdraw-users mailing list Can...@li...<mailto:Can...@li...> https://lists.sourceforge.net/lists/listinfo/canvasdraw-users |
From: Antonio S. <ant...@gm...> - 2019-04-13 19:16:02
|
Yes, you are missing... You have to allocate memory for those pointers. malloc(w * h) For each one. Use cdCanvasGetSize instead of an IUP attribute. It will be more coherent and avoid native borders that are not computed in the canvas drawing area. Best, Scuri Em sáb, 13 de abr de 2019 16:11, Matic Kukovec <kuk...@ho...> escreveu: > Hi Antonio, > > Thanks for the hint. I'm trying to use the *cdCanvasGetImageRGB* > function, but it throws a segmentation fault. I'm using this: > > cdCanvas* cd_canvas = (cdCanvas*)IupGetAttribute(iup_canvas, "cdCanvas"); > int ch, cw; > IupGetIntInt(iup_canvas, &ch, &cw); > unsigned char* r, g, b; > cdCanvasGetImageRGB(cd_canvas, r, g, b, 0, 0, cw, ch); // Throws a > segfault! > > > The last line throws a segfault if *cw *and *ch *are anything except *0, > 0*. But the *r*, *g* and *b* are all *null*. > I'm probably missing something, any ideas? > > Matic > ------------------------------ > *From:* Antonio Scuri <ant...@gm...> > *Sent:* Saturday, April 13, 2019 8:15 PM > *To:* CD discussion list. > *Subject:* Re: [Canvasdraw-users] Get pixel RGB information? > > No. Actually almost all graphics libraries do not have pixel access > anymore. > > In CD there are two ways, you can use cdCanvasGetImageRGB to retreive an > image of the canvas, then inspect its pixels. Or use the CD_IMAGERGB driver > where you are drawing in an image where you can access its buffer. > > Best, > Scuri > > > Em sáb, 13 de abr de 2019 às 15:05, Matic Kukovec < > kuk...@ho...> escreveu: > > Hi, > > Is there a way to get RGB color information of a specific pixel on a > canvas? > Maybe something like *cdCanvasGetImageRGB* but for the canvas? > > Thanks, > Matic > _______________________________________________ > Canvasdraw-users mailing list > Can...@li... > https://lists.sourceforge.net/lists/listinfo/canvasdraw-users > > _______________________________________________ > Canvasdraw-users mailing list > Can...@li... > https://lists.sourceforge.net/lists/listinfo/canvasdraw-users > |
From: Matic K. <kuk...@ho...> - 2019-04-13 19:11:15
|
Hi Antonio, Thanks for the hint. I'm trying to use the cdCanvasGetImageRGB function, but it throws a segmentation fault. I'm using this: cdCanvas* cd_canvas = (cdCanvas*)IupGetAttribute(iup_canvas, "cdCanvas"); int ch, cw; IupGetIntInt(iup_canvas, &ch, &cw); unsigned char* r, g, b; cdCanvasGetImageRGB(cd_canvas, r, g, b, 0, 0, cw, ch); // Throws a segfault! The last line throws a segfault if cw and ch are anything except 0, 0. But the r, g and b are all null. I'm probably missing something, any ideas? Matic ________________________________ From: Antonio Scuri <ant...@gm...> Sent: Saturday, April 13, 2019 8:15 PM To: CD discussion list. Subject: Re: [Canvasdraw-users] Get pixel RGB information? No. Actually almost all graphics libraries do not have pixel access anymore. In CD there are two ways, you can use cdCanvasGetImageRGB to retreive an image of the canvas, then inspect its pixels. Or use the CD_IMAGERGB driver where you are drawing in an image where you can access its buffer. Best, Scuri Em sáb, 13 de abr de 2019 às 15:05, Matic Kukovec <kuk...@ho...<mailto:kuk...@ho...>> escreveu: Hi, Is there a way to get RGB color information of a specific pixel on a canvas? Maybe something like cdCanvasGetImageRGB but for the canvas? Thanks, Matic _______________________________________________ Canvasdraw-users mailing list Can...@li...<mailto:Can...@li...> https://lists.sourceforge.net/lists/listinfo/canvasdraw-users |
From: Antonio S. <ant...@gm...> - 2019-04-13 18:15:56
|
No. Actually almost all graphics libraries do not have pixel access anymore. In CD there are two ways, you can use cdCanvasGetImageRGB to retreive an image of the canvas, then inspect its pixels. Or use the CD_IMAGERGB driver where you are drawing in an image where you can access its buffer. Best, Scuri Em sáb, 13 de abr de 2019 às 15:05, Matic Kukovec <kuk...@ho...> escreveu: > Hi, > > Is there a way to get RGB color information of a specific pixel on a > canvas? > Maybe something like *cdCanvasGetImageRGB* but for the canvas? > > Thanks, > Matic > _______________________________________________ > Canvasdraw-users mailing list > Can...@li... > https://lists.sourceforge.net/lists/listinfo/canvasdraw-users > |
From: Matic K. <kuk...@ho...> - 2019-04-13 18:05:50
|
Hi, Is there a way to get RGB color information of a specific pixel on a canvas? Maybe something like cdCanvasGetImageRGB but for the canvas? Thanks, Matic |
From: Matic K. <kuk...@ho...> - 2019-04-08 20:47:54
|
It works! Thank you Antonio! Matic ________________________________ From: Antonio Scuri <ant...@gm...> Sent: Monday, April 8, 2019 10:37 PM To: CD discussion list. Subject: Re: [Canvasdraw-users] Draw a gradient You will need the cdcontextplus.* files. That's where the cdInitContexPlus function is. Best, Scuri Em seg, 8 de abr de 2019 às 17:34, Matic Kukovec <kuk...@ho...<mailto:kuk...@ho...>> escreveu: Great, that is probably it, but now I get an DLL import error. Is there an external library needed that is not in the Windows MinGW precompiled pack "cd-5.12_Win64_dllw6_lib" from SourceForge? Matic ________________________________ From: Antonio Scuri <ant...@gm...<mailto:ant...@gm...>> Sent: Monday, April 8, 2019 10:29 PM To: CD discussion list. Subject: Re: [Canvasdraw-users] Draw a gradient Without those two calls you will be using the GDI driver. Using them the GDI+ driver is activated. It is easy to notice the difference on diagonal lines that are drawn with anti-aliasing. Best, Scuri Em seg, 8 de abr de 2019 às 17:23, Antonio Scuri <ant...@gm...<mailto:ant...@gm...>> escreveu: And I forgot to add, you must call cdInitContexPlus once, for instance where you call IupOpen. No particular order. Best, Scuri Em seg, 8 de abr de 2019 17:15, Matic Kukovec <kuk...@ho...<mailto:kuk...@ho...>> escreveu: Hi Antonio, I tried adding cdUseContextPlus(1) before cdCreateCanvas but nothing changes. I added it to the "MAP_CB" callback where it is created: int canvas_map_cb(Ihandle* canvas) { cdUseContextPlus(1); cdCanvas* cd_canvas = cdCreateCanvas(CD_IUPDBUFFER, canvas); IupSetAttribute(canvas, "cdCanvas", (char*)cd_canvas); return IUP_DEFAULT; } This is what I get: [X] Just for information, I'm using a very simplified and adapted version of example4_3.c from the website, into which I just added the CD code. I have a feeling I'm still missing something, any ideas? Thanks, Matic ________________________________ From: Antonio Scuri <ant...@gm...<mailto:ant...@gm...>> Sent: Monday, April 8, 2019 10:00 PM To: CD discussion list. Subject: Re: [Canvasdraw-users] Draw a gradient Hi, Are you calling cdUseContextPlus(1) before cdCreateCanvas? Best, Scuri Em seg, 8 de abr de 2019 16:46, Matic Kukovec <kuk...@ho...<mailto:kuk...@ho...>> escreveu: Hi guys, I'm trying to draw a gradient using the code shown in the Drivers > Context Plus > GDI+ documentation, which I'm using inside the iup_canvas's "ACTION" callback: int canvas_action_cb(Ihandle* iup_canvas) { int w, h; cdCanvas* cd_canvas = (cdCanvas*)IupGetAttribute(iup_canvas, "cdCanvas"); IupGetIntInt(canvas, "DRAWSIZE", &w, &h); cdCanvasForeground(cd_canvas, CD_YELLOW); cdCanvasBackground(cd_canvas, CD_GREEN); cdCanvasSetfAttribute(cd_canvas, "LINEARGRADIENT", "%d 200 %d 250", w - 150, w - 100); /* x1 y1 x2 y2 */ cdCanvasBox(cd_canvas, w - 150, w - 100, 200, 250); cdCanvasFlush(cd_canvas); return IUP_DEFAULT; } but it just draws a rectangle instead of gradient. I know this is working because I can draw a line or rectangle (with cdCanvasLine and cdCanvasRect) without any problems. I do not have any experience with this, so could someone help me please? I'm on Windows 10 x64 using IUP 3.26 and CD 5.12. Thanks, Matic _______________________________________________ Canvasdraw-users mailing list Can...@li...<mailto:Can...@li...> https://lists.sourceforge.net/lists/listinfo/canvasdraw-users _______________________________________________ Canvasdraw-users mailing list Can...@li...<mailto:Can...@li...> https://lists.sourceforge.net/lists/listinfo/canvasdraw-users _______________________________________________ Canvasdraw-users mailing list Can...@li...<mailto:Can...@li...> https://lists.sourceforge.net/lists/listinfo/canvasdraw-users |
From: Antonio S. <ant...@gm...> - 2019-04-08 20:37:38
|
You will need the cdcontextplus.* files. That's where the cdInitContexPlus function is. Best, Scuri Em seg, 8 de abr de 2019 às 17:34, Matic Kukovec <kuk...@ho...> escreveu: > Great, that is probably it, but now I get an *DLL import error*. Is there > an external library needed that is not in the Windows MinGW precompiled > pack "*cd-5.12_Win64_dllw6_lib*" from SourceForge? > > Matic > ------------------------------ > *From:* Antonio Scuri <ant...@gm...> > *Sent:* Monday, April 8, 2019 10:29 PM > *To:* CD discussion list. > *Subject:* Re: [Canvasdraw-users] Draw a gradient > > Without those two calls you will be using the GDI driver. Using them the > GDI+ driver is activated. It is easy to notice the difference on diagonal > lines that are drawn with anti-aliasing. > > Best, > Scuri > > > > > Em seg, 8 de abr de 2019 às 17:23, Antonio Scuri <ant...@gm...> > escreveu: > > And I forgot to add, you must call cdInitContexPlus once, for instance > where you call IupOpen. No particular order. > > Best, > Scuri > > Em seg, 8 de abr de 2019 17:15, Matic Kukovec <kuk...@ho...> > escreveu: > > Hi Antonio, > > I tried adding *cdUseContextPlus(1)* before *cdCreateCanvas* but nothing > changes. I added it to the "*MAP_CB*" callback where it is created: > > > int canvas_map_cb(Ihandle* canvas) > { > > cdUseContextPlus(1); > cdCanvas* cd_canvas = cdCreateCanvas(CD_IUPDBUFFER, canvas); > > IupSetAttribute(canvas, "cdCanvas", (char*)cd_canvas); > return IUP_DEFAULT; > > } > > This is what I get: > Just for information, I'm using a very simplified and adapted version of > *example4_3.c* from the website, into which I just added the CD code. > > I have a feeling I'm still missing something, any ideas? > > Thanks, > Matic > ------------------------------ > *From:* Antonio Scuri <ant...@gm...> > *Sent:* Monday, April 8, 2019 10:00 PM > *To:* CD discussion list. > *Subject:* Re: [Canvasdraw-users] Draw a gradient > > Hi, > > Are you calling cdUseContextPlus(1) before cdCreateCanvas? > > Best, > Scuri > > > Em seg, 8 de abr de 2019 16:46, Matic Kukovec <kuk...@ho...> > escreveu: > > Hi guys, > > I'm trying to draw a gradient using the code shown in the *Drivers > > Context Plus > GDI+* documentation, which I'm using inside the > *iup_canvas's* "*ACTION*" callback: > > int canvas_action_cb(Ihandle* iup_canvas) > { > > int w, h; > > cdCanvas* cd_canvas = (cdCanvas*)IupGetAttribute(iup_canvas, "cdCanvas"); > IupGetIntInt(canvas, "DRAWSIZE", &w, &h); > cdCanvasForeground(cd_canvas, CD_YELLOW); > cdCanvasBackground(cd_canvas, CD_GREEN); > cdCanvasSetfAttribute(cd_canvas, "LINEARGRADIENT", "%d 200 %d 250", w - > 150, w - 100); /* x1 y1 x2 y2 */ > cdCanvasBox(cd_canvas, w - 150, w - 100, 200, 250); > cdCanvasFlush(cd_canvas); > return IUP_DEFAULT; > > } > > but it just draws a rectangle instead of gradient. I know this is working > because I can draw a line or rectangle (with cdCanvasLine and cdCanvasRect) > without any problems. > I do not have any experience with this, so could someone help me please? > > I'm on Windows 10 x64 using IUP 3.26 and CD 5.12. > > Thanks, > Matic > > > _______________________________________________ > Canvasdraw-users mailing list > Can...@li... > https://lists.sourceforge.net/lists/listinfo/canvasdraw-users > > _______________________________________________ > Canvasdraw-users mailing list > Can...@li... > https://lists.sourceforge.net/lists/listinfo/canvasdraw-users > > _______________________________________________ > Canvasdraw-users mailing list > Can...@li... > https://lists.sourceforge.net/lists/listinfo/canvasdraw-users > |
From: Matic K. <kuk...@ho...> - 2019-04-08 20:34:49
|
Great, that is probably it, but now I get an DLL import error. Is there an external library needed that is not in the Windows MinGW precompiled pack "cd-5.12_Win64_dllw6_lib" from SourceForge? Matic ________________________________ From: Antonio Scuri <ant...@gm...> Sent: Monday, April 8, 2019 10:29 PM To: CD discussion list. Subject: Re: [Canvasdraw-users] Draw a gradient Without those two calls you will be using the GDI driver. Using them the GDI+ driver is activated. It is easy to notice the difference on diagonal lines that are drawn with anti-aliasing. Best, Scuri Em seg, 8 de abr de 2019 às 17:23, Antonio Scuri <ant...@gm...<mailto:ant...@gm...>> escreveu: And I forgot to add, you must call cdInitContexPlus once, for instance where you call IupOpen. No particular order. Best, Scuri Em seg, 8 de abr de 2019 17:15, Matic Kukovec <kuk...@ho...<mailto:kuk...@ho...>> escreveu: Hi Antonio, I tried adding cdUseContextPlus(1) before cdCreateCanvas but nothing changes. I added it to the "MAP_CB" callback where it is created: int canvas_map_cb(Ihandle* canvas) { cdUseContextPlus(1); cdCanvas* cd_canvas = cdCreateCanvas(CD_IUPDBUFFER, canvas); IupSetAttribute(canvas, "cdCanvas", (char*)cd_canvas); return IUP_DEFAULT; } This is what I get: [X] Just for information, I'm using a very simplified and adapted version of example4_3.c from the website, into which I just added the CD code. I have a feeling I'm still missing something, any ideas? Thanks, Matic ________________________________ From: Antonio Scuri <ant...@gm...<mailto:ant...@gm...>> Sent: Monday, April 8, 2019 10:00 PM To: CD discussion list. Subject: Re: [Canvasdraw-users] Draw a gradient Hi, Are you calling cdUseContextPlus(1) before cdCreateCanvas? Best, Scuri Em seg, 8 de abr de 2019 16:46, Matic Kukovec <kuk...@ho...<mailto:kuk...@ho...>> escreveu: Hi guys, I'm trying to draw a gradient using the code shown in the Drivers > Context Plus > GDI+ documentation, which I'm using inside the iup_canvas's "ACTION" callback: int canvas_action_cb(Ihandle* iup_canvas) { int w, h; cdCanvas* cd_canvas = (cdCanvas*)IupGetAttribute(iup_canvas, "cdCanvas"); IupGetIntInt(canvas, "DRAWSIZE", &w, &h); cdCanvasForeground(cd_canvas, CD_YELLOW); cdCanvasBackground(cd_canvas, CD_GREEN); cdCanvasSetfAttribute(cd_canvas, "LINEARGRADIENT", "%d 200 %d 250", w - 150, w - 100); /* x1 y1 x2 y2 */ cdCanvasBox(cd_canvas, w - 150, w - 100, 200, 250); cdCanvasFlush(cd_canvas); return IUP_DEFAULT; } but it just draws a rectangle instead of gradient. I know this is working because I can draw a line or rectangle (with cdCanvasLine and cdCanvasRect) without any problems. I do not have any experience with this, so could someone help me please? I'm on Windows 10 x64 using IUP 3.26 and CD 5.12. Thanks, Matic _______________________________________________ Canvasdraw-users mailing list Can...@li...<mailto:Can...@li...> https://lists.sourceforge.net/lists/listinfo/canvasdraw-users _______________________________________________ Canvasdraw-users mailing list Can...@li...<mailto:Can...@li...> https://lists.sourceforge.net/lists/listinfo/canvasdraw-users |
From: Antonio S. <ant...@gm...> - 2019-04-08 20:30:10
|
Without those two calls you will be using the GDI driver. Using them the GDI+ driver is activated. It is easy to notice the difference on diagonal lines that are drawn with anti-aliasing. Best, Scuri Em seg, 8 de abr de 2019 às 17:23, Antonio Scuri <ant...@gm...> escreveu: > And I forgot to add, you must call cdInitContexPlus once, for instance > where you call IupOpen. No particular order. > > Best, > Scuri > > Em seg, 8 de abr de 2019 17:15, Matic Kukovec <kuk...@ho...> > escreveu: > >> Hi Antonio, >> >> I tried adding *cdUseContextPlus(1)* before *cdCreateCanvas* but nothing >> changes. I added it to the "*MAP_CB*" callback where it is created: >> >> >> int canvas_map_cb(Ihandle* canvas) >> { >> >> cdUseContextPlus(1); >> cdCanvas* cd_canvas = cdCreateCanvas(CD_IUPDBUFFER, canvas); >> >> IupSetAttribute(canvas, "cdCanvas", (char*)cd_canvas); >> return IUP_DEFAULT; >> >> } >> >> This is what I get: >> Just for information, I'm using a very simplified and adapted version of >> *example4_3.c* from the website, into which I just added the CD code. >> >> I have a feeling I'm still missing something, any ideas? >> >> Thanks, >> Matic >> ------------------------------ >> *From:* Antonio Scuri <ant...@gm...> >> *Sent:* Monday, April 8, 2019 10:00 PM >> *To:* CD discussion list. >> *Subject:* Re: [Canvasdraw-users] Draw a gradient >> >> Hi, >> >> Are you calling cdUseContextPlus(1) before cdCreateCanvas? >> >> Best, >> Scuri >> >> >> Em seg, 8 de abr de 2019 16:46, Matic Kukovec <kuk...@ho...> >> escreveu: >> >> Hi guys, >> >> I'm trying to draw a gradient using the code shown in the *Drivers > >> Context Plus > GDI+* documentation, which I'm using inside the >> *iup_canvas's* "*ACTION*" callback: >> >> int canvas_action_cb(Ihandle* iup_canvas) >> { >> >> int w, h; >> >> cdCanvas* cd_canvas = (cdCanvas*)IupGetAttribute(iup_canvas, "cdCanvas"); >> IupGetIntInt(canvas, "DRAWSIZE", &w, &h); >> cdCanvasForeground(cd_canvas, CD_YELLOW); >> cdCanvasBackground(cd_canvas, CD_GREEN); >> cdCanvasSetfAttribute(cd_canvas, "LINEARGRADIENT", "%d 200 %d 250", w - >> 150, w - 100); /* x1 y1 x2 y2 */ >> cdCanvasBox(cd_canvas, w - 150, w - 100, 200, 250); >> cdCanvasFlush(cd_canvas); >> return IUP_DEFAULT; >> >> } >> >> but it just draws a rectangle instead of gradient. I know this is working >> because I can draw a line or rectangle (with cdCanvasLine and cdCanvasRect) >> without any problems. >> I do not have any experience with this, so could someone help me please? >> >> I'm on Windows 10 x64 using IUP 3.26 and CD 5.12. >> >> Thanks, >> Matic >> >> >> _______________________________________________ >> Canvasdraw-users mailing list >> Can...@li... >> https://lists.sourceforge.net/lists/listinfo/canvasdraw-users >> >> _______________________________________________ >> Canvasdraw-users mailing list >> Can...@li... >> https://lists.sourceforge.net/lists/listinfo/canvasdraw-users >> > |