[WINDOWS] PLOTTER

User contributed sources that have become inactive, deprecated, or generally unusable. But ... we don't really want to throw them away either.
Hard
Posts: 135
Joined: Aug 29, 2008 21:13

[WINDOWS] PLOTTER

Post by Hard »

i wrote a little function plotter:
Image

download: klick

as calculation is based on lua, you can use the lua math commands. such as pow, sin, cos, acos, tan, atan, abs, random ... juste write a function in the textbox and press enter.

graph drawing is based on gdi+ ... see my tip: klick
AGS
Posts: 1284
Joined: Sep 25, 2007 0:26
Location: the Netherlands

Re: [WINDOWS] PLOTTER

Post by AGS »

Where is the source? Is it LUA - only or does it combine LUA with FB?
Could you put the source online?
Last edited by AGS on Mar 25, 2009 7:13, edited 2 times in total.
Hard
Posts: 135
Joined: Aug 29, 2008 21:13

Post by Hard »

actually i never wanted to rls the source, but as i am a gracefully person:
klick

btw it is fb with lua scripting (for the math function) and pls remove the quote, it is unnecessary ...

anyway i need sth like autoredraw. plot a graph and put an other form on top and then look at the graph again (its cleared). any ideas?
Last edited by Hard on Mar 23, 2009 13:51, edited 2 times in total.
nkk_kan
Posts: 209
Joined: May 18, 2007 13:01
Location: India
Contact:

Post by nkk_kan »

Nice little program!
Sometimes when i draw a graph .. It draws the waveform and then clears it for some reason..any ideas?

Also, Variable amplitude and some tweaks like colour and multiple graphs would be nice idea too ;p
Hard
Posts: 135
Joined: Aug 29, 2008 21:13

Post by Hard »

the clearing comes from windows

internal it clears forms, if they arent needed. usually i use autoredraw in vb. at this point i am a little bit stuck with wm_paint ... anyway i wont extend functionality, because this was a test for me to become familiar with the windows gui api.

variable amplitude? you mean scale?
cause amplitude -> amplitude * trigonometric function
AGS
Posts: 1284
Joined: Sep 25, 2007 0:26
Location: the Netherlands

Post by AGS »

Hard wrote:actually i never wanted to rls the source, but as i am a gracefully person:
Any particular reason for not wanting to release the source? I find reading source code written by others to be very instructive.
Hard wrote: anyway i need sth like autoredraw. plot a graph and put an other form on top and then look at the graph again (its cleared). any ideas?
Windows calls WM_PAINT when the dialog has been covered by some other window and it needs to be repainted. Same thing with resize, minimize etc...

And the plotter does not process WM_PAINT messages. Depending on the kind of event that occured (the window gets maximized , part of the window that was covered gets uncovered) you'll have to repaint the entire window or part of it.

So to get automatic repaint you could:
- handle the WM_PAINT message by
- redrawing the graph upon reception of WM_PAINT.

You should save the entered math command (it's in FUNCTION_ENTERED isn't it?). That way you could handle WM_PAINT as if receiving a WM_COMMAND (as if the user pressed enter after entering a math command).

I presume you've got a copy of Petzolds (e)book ('Programming Windows')?
Hard
Posts: 135
Joined: Aug 29, 2008 21:13

Post by Hard »

handling wm_paint as if receiving wm_command is way too slow. i use now a doublebuffer for the image and it works just fine now.

btw i havent read a single programming book :P

could you please remove the whole quote of my fist post. its just when i edit the first post ... you know ...
AGS
Posts: 1284
Joined: Sep 25, 2007 0:26
Location: the Netherlands

Post by AGS »

Hard wrote:handling wm_paint as if receiving wm_command is way too slow. i use now a doublebuffer for the image and it works just fine now.

btw i havent read a single programming book :P

could you please remove the whole quote of my fist post. its just when i edit the first post ... you know ...
I removed the whole quote.
Hard
Posts: 135
Joined: Aug 29, 2008 21:13

Post by Hard »

thanks :)
edexter
Posts: 42
Joined: Nov 09, 2008 16:09

Post by edexter »

I found a great number of these when I was looking, it is hard to be unique enough to get noticed plotting. As a project though it looks like an intresting example or learning project.. I was looking for a customizable drum/piano roll structure and the only thing I found was (c) att not to be redistributed exc exc (keyedit). Seems like every program shouldn't have to do the roll from scratch but be able to steal the plotting functions ...
deveah!
Posts: 30
Joined: Aug 13, 2008 15:35

Post by deveah! »

make it output .wav. Please. It could be the best sample generator for trackers. Ever!
Hard
Posts: 135
Joined: Aug 29, 2008 21:13

Post by Hard »

but be able to steal the plotting functions?

whats your point?
edexter
Posts: 42
Joined: Nov 09, 2008 16:09

Post by edexter »

I am not knocking the program in fact plotting programs are useful. I was just saying there are alot of plotting programs that are available for use, not that it is useless.. gnu plot can even be used for alogrithmic composition.... I was just suggesting the other as a killer graphics app that would be more unique, one that probily doesn't belong in this thread maybe..



(steal as in drop it into a set of programs as a feature)
Hard
Posts: 135
Joined: Aug 29, 2008 21:13

Post by Hard »

actually i won't continue this program. it was just a test for me, to get startet with windows gui programming.

anyway thanks for comments ;)

if someone is interested: i am working atm on a stats system:
Image
edexter
Posts: 42
Joined: Nov 09, 2008 16:09

Post by edexter »

It may be possible to get it to output a wav file... It is probily simplier to use csound or pure data or a c programming library... I was looking at the later and was able to complie a sound lib with lua scripting (in c) but didn't get much further.. Are your basic skill up to writting wrappers, I may have the library for you (I will have to look it up on my computer though)
Post Reply