canvas gadget

Just starting out? Need help? Post your questions and find answers here.
ehowington
Enthusiast
Enthusiast
Posts: 115
Joined: Sat Sep 12, 2009 3:06 pm

canvas gadget

Post by ehowington »

Ok ill post this again since I have not gotten any sorta response on this question I was wondering if there are some sorta examples of a drawing canvas for vector data similar to drawing canvas that FLEX has which you can pan/zoom/scale this canvas with controls. Is there anyone out there wondering the same thing?

Any thoughts on this would be greatly appreciated.

Thank you all in advance.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: canvas gadget

Post by srod »

Pan, zoom scale... your best bet would probably be to use an Enhanced metafile (Windows) and then play this to an image and seat this within an image gadget etc. Metafiles can be rescaled very easily.
I may look like a mule, but I'm not a complete ass.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: canvas gadget

Post by blueznl »

Dunno how far you want to take this, but the g_spot stuff provides with some of that functionality, though originally it was not designed to do so :-)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: canvas gadget

Post by Trond »

blueznl wrote:Dunno how far you want to take this, but the g_spot stuff provides with some of that functionality, though originally it was not designed to do so :-)
Did you upload it yet?
yrret
User
User
Posts: 26
Joined: Wed May 26, 2004 9:05 pm

Re: canvas gadget

Post by yrret »

From http://www.xs4all.nl/~bluez/purebasic/p ... #0_general
29.3 Sweetspot.
Under development.
I'm currently working on a new project called 'Sweetspot'. It's still very much a secret :-)

* Download Sweetspot. (Includes source code!)

* Sweetspot uses the g_spot resizing / 2D library. See g_spot in action on YouTube here and here.

G-spot.

One of Sweetspot's components is an include file called g_spot.pb. I have included it as part of the Sweetspot upload. (There's not much else in there right now.)

Download sweetspot.zip and look for the folder g_spot in there. In it you will find the include file, and a few examples. G-spot includes code to resize gadgets and windows and to do some limited 2D object handling and drawing, panning and zooming.
ehowington
Enthusiast
Enthusiast
Posts: 115
Joined: Sat Sep 12, 2009 3:06 pm

Re: canvas gadget

Post by ehowington »

looking at this now from what I see on the youtube exactly what I was looking for.
ehowington
Enthusiast
Enthusiast
Posts: 115
Joined: Sat Sep 12, 2009 3:06 pm

Re: canvas gadget

Post by ehowington »

sent ya a small mod to your code :)
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: canvas gadget

Post by blueznl »

I'll upload a newer version tonight.
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
ehowington
Enthusiast
Enthusiast
Posts: 115
Joined: Sat Sep 12, 2009 3:06 pm

Re: canvas gadget

Post by ehowington »

awsome love to see it
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: canvas gadget

Post by Trond »

How does it deal with conflicting rules? Like, setting gadget 1's x to gadget 2's x + 10 and vice versa at the same time.

Edit: "place object left ie. right of reference". That makes no sense. http://en.wikipedia.org/wiki/List_of_Latin_phrases_(I)
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: canvas gadget

Post by blueznl »

Trond wrote: How does it deal with conflicting rules? Like, setting gadget 1's x to gadget 2's x + 10 and vice versa at the same time.
Rules are processed in sequence, ie. a new rule can overrule an old rule. It's silly to do so, but it would't cause issues. Unless, for example, an object points to itself, and is told to move five pixels to the left on every call, ending up in a moving object :-)
Edit: "place object left ie. right of reference". That makes no sense. http://en.wikipedia.org/wiki/List_of_Latin_phrases_(I)
You are right. I think. I'll have a look at that, should probably be 'or' depending on the context.

I just uploaded the file. Though it may look cumbersome it's actually rather easy to implement into existing code, see the included samples.
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Post Reply