www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - line drawing package?

reply BCS <none anon.com> writes:
I find my self in need of a line drawing package. I need to pop a window 
and draw lines and points. Text would be nice but I can live without it. 
Most importantly, I need something that is dirt simple to get running. I 
don't have time to dink around with libs (if I did have time I'd be willing 
but I'm already way behind as it is).

Windows XP, D1.0, Phobos

I'd also be able to use an out of process solution as in: generate input 
file, call program if anyone knows of a windows program like that.
May 02 2009
next sibling parent reply Daniel Keep <daniel.keep.lists gmail.com> writes:
BCS wrote:
 I find my self in need of a line drawing package. I need to pop a window
 and draw lines and points. Text would be nice but I can live without it.
 Most importantly, I need something that is dirt simple to get running. I
 don't have time to dink around with libs (if I did have time I'd be
 willing but I'm already way behind as it is).
 
 Windows XP, D1.0, Phobos
 
 I'd also be able to use an out of process solution as in: generate input
 file, call program if anyone knows of a windows program like that.
I don't think you're going to get away without using a library. Cairo is good for drawing; it has a very easy to learn API. I had a binding, but haven't touched it in ages; it's in bindings on dsource.org if you want to take a crack at it. Failing that, the C api isn't that hard to learn. One issue is that it doesn't have any windowing functions. If you don't need live updates, you could always cheat by generating a PNG (which it can do out of the box) and then use the system image viewer to open it. Some URLs: Cairo: http://www.cairographics.org/ Old cairo binding (also includes a basic tutorial): http://dsource.org/projects/bindings/browser/trunk/cairo Win32 libraries (you want cairo, libpng and zlib): http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/ -- Daniel
May 02 2009
next sibling parent BCS <none anon.com> writes:
Hello Daniel,

 I don't think you're going to get away without using a library.
Libs are fine (if they run without to much trouble)
 
 Cairo is good for drawing; it has a very easy to learn API.  I had a
 binding, but haven't touched it in ages; it's in bindings on
 dsource.org if you want to take a crack at it.  Failing that, the C
 api isn't that hard to learn.
 
 One issue is that it doesn't have any windowing functions.  If you
 don't need live updates, you could always cheat by generating a PNG
 (which it can do out of the box) and then use the system image viewer
 to open it.
final target is a dead tree so that's fine.
 
 Some URLs:
 
 Cairo: http://www.cairographics.org/
 
 Old cairo binding (also includes a basic tutorial):
 http://dsource.org/projects/bindings/browser/trunk/cairo
 
 Win32 libraries (you want cairo, libpng and zlib):
 http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/
it seems to be wanting libpng13.dll and I can't seem to find that.
 
 -- Daniel
 
May 03 2009
prev sibling parent BCS <none anon.com> writes:
Hello Daniel,

 Cairo is good for drawing; it has a very easy to learn API.  I had a
 binding, but haven't touched it in ages; it's in bindings on
 dsource.org if you want to take a crack at it.  Failing that, the C
 api isn't that hard to learn.
 
 Some URLs:
 
 Cairo: http://www.cairographics.org/
 
 Old cairo binding (also includes a basic tutorial):
 http://dsource.org/projects/bindings/browser/trunk/cairo
 
 Win32 libraries (you want cairo, libpng and zlib):
 http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/
 
 -- Daniel
 
Works well. I needed to find libpng13.dll (it wasn't on the site you listed) but that might have been from an odd version issue or some such. I ended up taking about 2 hours to sort the kinks out but about half of that was figuring out how to make my data feed into Cairo.
May 03 2009
prev sibling next sibling parent Bill Baxter <wbaxter gmail.com> writes:
SDL via Derelict is probably the easiest thing to get working quickly.
I think SDL has some kind of simple line drawing API.

SDL for opening the window with drawing done by GL wouldn't be hard
either, if you already know the GL api.

Neither will give you high-quality antialiased lines, though.

--bb

On Sat, May 2, 2009 at 6:29 PM, BCS <none anon.com> wrote:
 I find my self in need of a line drawing package. I need to pop a window and
 draw lines and points. Text would be nice but I can live without it. Most
 importantly, I need something that is dirt simple to get running. I don't
 have time to dink around with libs (if I did have time I'd be willing but
 I'm already way behind as it is).

 Windows XP, D1.0, Phobos

 I'd also be able to use an out of process solution as in: generate input
 file, call program if anyone knows of a windows program like that.
May 02 2009
prev sibling next sibling parent bearophile <bearophileHUGS lycos.com> writes:
BCS Wrote:
 I find my self in need of a line drawing package. I need to pop a window 
 and draw lines and points. Text would be nice but I can live without it. 
You may try this, the second test requires random numbers that are not included: http://www.fantascienza.net/leonardo/graphics.rar (That file will vanish from the server in a day or two). Bye, bearophile
May 03 2009
prev sibling next sibling parent Christopher Wright <dhasenan gmail.com> writes:
BCS wrote:
 I find my self in need of a line drawing package. I need to pop a window 
 and draw lines and points. Text would be nice but I can live without it. 
 Most importantly, I need something that is dirt simple to get running. I 
 don't have time to dink around with libs (if I did have time I'd be 
 willing but I'm already way behind as it is).
 
 Windows XP, D1.0, Phobos
 
 I'd also be able to use an out of process solution as in: generate input 
 file, call program if anyone knows of a windows program like that.
http://www.dsource.org/projects/scrapple/wiki/QD
May 03 2009
prev sibling parent reply John C <johnch_atms hotmail.com> writes:
BCS Wrote:

 I find my self in need of a line drawing package. I need to pop a window 
 and draw lines and points. Text would be nice but I can live without it. 
 Most importantly, I need something that is dirt simple to get running. I 
 don't have time to dink around with libs (if I did have time I'd be willing 
 but I'm already way behind as it is).
 
 Windows XP, D1.0, Phobos
 
 I'd also be able to use an out of process solution as in: generate input 
 file, call program if anyone knows of a windows program like that.
 
 
Had you ruled out CreateWindowEx, LineTo and DrawText from the Win32 API?
May 03 2009
next sibling parent reply Bill Baxter <wbaxter gmail.com> writes:
On Sun, May 3, 2009 at 5:15 AM, John C <johnch_atms hotmail.com> wrote:
 BCS Wrote:

 I find my self in need of a line drawing package. I need to pop a window
 and draw lines and points. Text would be nice but I can live without it.
 Most importantly, I need something that is dirt simple to get running. I
 don't have time to dink around with libs (if I did have time I'd be willing
 but I'm already way behind as it is).

 Windows XP, D1.0, Phobos

 I'd also be able to use an out of process solution as in: generate input
 file, call program if anyone knows of a windows program like that.
Had you ruled out CreateWindowEx, LineTo and DrawText from the Win32 API?
If there are bindings for GDI+ then that gets you nice antialiased lines too. --bb
May 03 2009
parent Jacob Carlborg <doob me.com> writes:
Bill Baxter wrote:
 On Sun, May 3, 2009 at 5:15 AM, John C <johnch_atms hotmail.com> wrote:
 BCS Wrote:

 I find my self in need of a line drawing package. I need to pop a window
 and draw lines and points. Text would be nice but I can live without it.
 Most importantly, I need something that is dirt simple to get running. I
 don't have time to dink around with libs (if I did have time I'd be willing
 but I'm already way behind as it is).

 Windows XP, D1.0, Phobos

 I'd also be able to use an out of process solution as in: generate input
 file, call program if anyone knows of a windows program like that.
Had you ruled out CreateWindowEx, LineTo and DrawText from the Win32 API?
If there are bindings for GDI+ then that gets you nice antialiased lines too. --bb
If neither phobos or tango contains bindings to GDI+ there are bindings in dwt-win32.
May 03 2009
prev sibling parent BCS <none anon.com> writes:
Hello John,

 Had you ruled out CreateWindowEx, LineTo and DrawText from the Win32
 API?
 
The time it would take me to figure out how to use the windows API at all would soak up most of my time budget. I have neved done GUI outside c#.
May 03 2009