Image Plugin - Simple drawing pane

Questions about NeoBook PlugIns

Moderator: Neosoft Support

User avatar
HPW
Posts: 2571
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany
Contact:

Re: Image Plugin - Simple drawing pane

Post by HPW »

When you want to see the scripts, open the hpwImageCreate wizard and click on the action-edit button near the action field you want to see.
Then you get a readable script how it is performed in the event.

Regards
Hans-Peter
schmutly
Posts: 217
Joined: Fri Feb 20, 2009 4:16 pm

Re: Image Plugin - Simple drawing pane

Post by schmutly »

Did that & that helped to understand the process.
Thanks again Hans.
Rob
User avatar
HPW
Posts: 2571
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany
Contact:

Re: Image Plugin - Simple drawing pane

Post by HPW »

Tip: When you want to change event behaviour in an existing Image you can use hpwImageSetActions.
Hans-Peter
schmutly
Posts: 217
Joined: Fri Feb 20, 2009 4:16 pm

Re: Image Plugin - Simple drawing pane

Post by schmutly »

OK, thanks muchly Hans.
Also wanted to ask while i remember, i like the Inslink arrow used in the HPWSimpleGraph but
obviously i cant attach & use that in the same Image Rectangle as HpwImage.
I'm trying to 'annotate' and draw on an image (your code gave me that last night thx)
but also have an arrow image placed so i can point at some text or something in image.
Its ok, i have enough to go on and work my way through stuff you've shown me now, was checking that a feature like the
hpwSimpleGraphInsLink couldn't be utilized WITH HpwImage.
OK...you've given me some things to work on now,lots to learn and some of
the examples look real complex..i need extra coffee as i go through them :lol: .
Rob
User avatar
HPW
Posts: 2571
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany
Contact:

Re: Image Plugin - Simple drawing pane

Post by HPW »

You can save your arrow image in a file and load it to a position in hpwImage.
Or maybe you want to use the stamp feature to visually place the arrow.

Generic scripting allows much different options.
Hans-Peter
schmutly
Posts: 217
Joined: Fri Feb 20, 2009 4:16 pm

Re: Image Plugin - Simple drawing pane

Post by schmutly »

Yes, i was going to use the stamp feature & then will just need to workout
how to 'rotate' it with mouse into the right angle position.
But...that's step 10 so i am not there yet, thanks for suggestions.
I'm enjoying working through this..thanks for the great
plugins.
Rob
schmutly
Posts: 217
Joined: Fri Feb 20, 2009 4:16 pm

Re: Image Plugin - Simple drawing pane

Post by schmutly »

Hans,
How can i increase the 'drawing thickness' of mouse..is there an
option for that in hpwImage? Its one pixel at moment.
Thx
User avatar
HPW
Posts: 2571
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany
Contact:

Re: Image Plugin - Simple drawing pane

Post by HPW »

Just upload a new hpwImage 2.57:

http://www.hpwsoft.de/anmeldung/html1/n ... book5.html

Action: hpwImageDrawLine, hpwImageDrawLines and hpwImageRectangle gets an additional paramter pen-width.

Caution: Using this new version will break existing pub's because of the additional parameter. Add at least an empty parameter to get default pixel width 1.

Regards
Hans-Peter
schmutly
Posts: 217
Joined: Fri Feb 20, 2009 4:16 pm

Re: Image Plugin - Simple drawing pane

Post by schmutly »

:mrgreen: Your a legend,
thank you Hans, appreciate that.
Sent a donation too..Have Good Weekend.
Robbie
ps: Can you add that option to the hpwImageFrameRect
in the next release if possible? I'm using this option to
rubber-band around text to highlight it. I looked at
how you did the scripting for the freehand drawing
and just trying to do that with the frame now, so
a thicker border for frame would be great for frame ;)
Thanks again.
User avatar
HPW
Posts: 2571
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany
Contact:

Re: Image Plugin - Simple drawing pane

Post by HPW »

Hello,

Unfourtunatly no, I had looked at it too, but the Delphi function FrameRect does not support it.
And how would you restore the background when you move the Cursor.
hpwImageGetRectArea would do this, but is currently also only one Pixel. Have to look at it.
Thanks for the donation, happens not often.

Regards
Hans-Peter
User avatar
HPW
Posts: 2571
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany
Contact:

Re: Image Plugin - Simple drawing pane

Post by HPW »

Just upload a new hpwImage 2.58:

http://www.hpwsoft.de/anmeldung/html1/n ... book5.html

Action: hpwImageFrameRect and hpwImageGetRectArea gets an additional paramter frame-width 1-5.

As I told the delphi FrameRect does not support a pen width.
As a workaround I implemented that it does it simply multiple times with 1 pixel. (1 - 5 supported)
Note that it work from the outer specified coordinate to the inner.
And GetRectArea will still return the outer coordinate.
Note also that hpwImageDrawLine, hpwImageDrawLines and hpwImageRectangle uses pen-width which draw to both sides of the coordinates.

Again Caution: Using this new version will break existing pub's because of the additional parameter. Add at least an empty parameter to get default pixel width 1.

Regards
Hans-Peter
schmutly
Posts: 217
Joined: Fri Feb 20, 2009 4:16 pm

Re: Image Plugin - Simple drawing pane

Post by schmutly »

Thanks so much Hans,
your remarkable :D
Um, can you explain what you mean by breaking the Pubs?
What do i need to look out for that would cause it to break?
I guess i am safe as i am still working my way through creating this
so all seems ok so far.
Thanks for your efforts and updates,
Robbie
User avatar
HPW
Posts: 2571
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany
Contact:

Re: Image Plugin - Simple drawing pane

Post by HPW »

Hello,
Um, can you explain what you mean by braking the Pubs?
If you have a pub that it is using that commands, you have inserted them with the old number of parameters.
When you run them you will get an error from neobook that you have defined too less parameters.
So you have to search through your pub and add everywhere at least a empty "" parameter.

So you have to think about before installing the 2 latest versions, when you want to run/compile old pub-versions.

Regards
Hans-Peter
schmutly
Posts: 217
Joined: Fri Feb 20, 2009 4:16 pm

Re: Image Plugin - Simple drawing pane

Post by schmutly »

Ah..understood.Have come across that before with some
of Davids plugins after an update.Thanks.
User avatar
HPW
Posts: 2571
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany
Contact:

Re: Image Plugin - Simple drawing pane

Post by HPW »

I noticed on my win-tablet that it is better in the Drawline-LeftDown Action to change to this code:

Code: Select all

SetVar "[LastX]" "RGetAreaImage_LDownX"
SetVar "[LastY]" "RGetAreaImage_LDownY"
SetVar "[DrawOnMove]" "1"
(From the freehand sample here in the thread)

Regards
Hans-Peter
Locked