Page 1 of 1
setting the brushColor to transparent color
Posted: Tue Jul 29, 2008 4:25 pm
by mfstuart
Hi all,
I posted this question on the rev-list and got no answer as yet. So here goes.
Can the brushColor have a transparency to it?
eg: in my application, the user can import a snapshot and then with a click of a button, set the tool to a brush and then pick a color (yellow) to hilite part of the imported image. Such as using the Sharpie Highlighter on a printed document.
So the color has to have transparency setting. Otherwise using the brush will just wipe over with the selected yellow.
TIA,
Mark Stuart
Posted: Tue Jul 29, 2008 5:41 pm
by Klaus
Hi Mark,
Can the brushColor have a transparency to it?
To make it short, no it can't.
Best
Klaus
re: setting the brushColor to transparent color
Posted: Tue Jul 29, 2008 5:59 pm
by mfstuart
Ouch!
Danke Klaus.
I'll submit an enhancement request.
Posted: Tue Jul 29, 2008 7:41 pm
by bn
Hi Mark,
you could probably overlay your snapshot with an empty image of the same size and set the transparency of this image to about 50 to 60. Then your user can hilite the part of the imported image with a yellow 'pen' on your overlay.
Depending on your needs this might work. If you want to preserve the markings you could again take a snapshot?
regards
Bernd
Posted: Tue Jul 29, 2008 10:42 pm
by mfstuart
Bernd,
I did as you suggested, and that worked for me.
On a test stack, I imported an image, added an image object (the overlay), set the Blending level to 60. Manually selected the brush and set the color. "Swiped" over the image and walla - it works, I have transparency on the overlay.
Now to make it work like SnagIt - hold mouse down and drag, creates a square/oblong shape with handles to allow the user to move the overlay and change its shape/dimensions. Cool.
Thanx,
Mark Stuart
Posted: Tue Jul 29, 2008 11:34 pm
by bn
Hi Mark,
glad it worked for you.
just in case you want to 'freeze' the changes to the pict and you want to do it with a snapshot you will want to use the global coordinates to reference the area of the first image, since refering to the rect of the first image gives you a snapshot without the overlay.
if you refer to the first image:
Code: Select all
put the rect of image "NameOfFirstImage" into myRect
put item 1 to 2 of myRect into tTopLeft
put item 3 to 4 of myRect into tBottomRight
put globalloc(tTopLeft) into item 1 to 2 of myRect
put globalloc(tBottomRight) into item 3 to 4 of myRect
import snapshot from rect myRect
above code as a reminder (to myself)..., because I ran into this problem
cheers
Bernd
Posted: Wed Jul 30, 2008 2:27 am
by mfstuart
Hi Bernd,
Haven't tried your code as yet, but does it capture the "overlay" as well?
What I would like to do...
Option to "flatten the image" to not only capture the original image, but also the "additions" by the user into the "overlay" image. Basically, this would combine all overlays into one image.
cheers,
Mark Sruart
Posted: Wed Jul 30, 2008 5:25 am
by Janschenkel
Another solution for 'flattening' your image is to group the two (or more) images and then use the following one-liner:
Code: Select all
export snapshot from group "ImageAndOverlays" to file theFilePath as PNG
Instead of PNG, you can also use JPEG or GIF. If your software has a trial version, you could add a translucent field with white text to the mix in order to watermark the image.
The advantage of this approach is that it's done entirely in Revolution's back-buffer, and a suddenly appearing overlapping window can't interfere with it.
Hope this helped,
Jan Schenkel.
Posted: Wed Jul 30, 2008 9:18 am
by bn
Hi Mark,
If you take the snapshot from the global coordinates as in the code I posted it "flattens" the image, i.e. takes a snapshot from the original image and the second image with the marks.
Also Jan posted a different approach to flattening the image by grouping them.
BTW you probably could do similar things with graphics on top of your first image, should work just as well and depending on what you want might be a consideration (it would probably easier to implement an undo among other things) just set the opaque of the graphic to false, adjust color
"set the foregroundcolor of graphic "xyz" to red" etc.
regards
Posted: Thu Jul 31, 2008 10:04 pm
by mfstuart
Hi Jan and bn,
Awesome suggestions that I had no idea how to do, so thank you both.
I'm currently in the midst of releasing a new version of our companies software product (CRM) in my day job, so will try your suggestions real soon. And post the results here.
Regards,
Mark Stuart