Putting image into a circle shape
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Putting image into a circle shape
Hi all, the livecode built in image only allows square images . The property does not have any ways to change the shape. Do I have to use a graphic in this case?
Thank you for your kind replies.
Thank you for your kind replies.
Eddie
Re: Putting image into a circle shape
What are you trying to do with the image? There are different ways of dealing with this depending on what your interactions with the image are (eg collision detection, mouseover actions etc).
Most can probably be dealt with by transparency settings, but can be enhanced with one of Hermann's nifty stacks with frame masking, or possibly as a background pattern in a graphic if it really needs to be, as in the hex tile creation thread. http://forums.livecode.com/viewtopic.php?f=22&t=31212
Most can probably be dealt with by transparency settings, but can be enhanced with one of Hermann's nifty stacks with frame masking, or possibly as a background pattern in a graphic if it really needs to be, as in the hex tile creation thread. http://forums.livecode.com/viewtopic.php?f=22&t=31212
-
- Livecode Opensource Backer
- Posts: 9385
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Putting image into a circle shape
Personally I'd make a circular graphic, store your image off-screen
and then set the backGroundPattern of the graphic to your picture.
- -
-
If you want to save storage space you can subsequently take a snapshot
of the circular graphic and delete both it and the original image.
and then set the backGroundPattern of the graphic to your picture.
- -
Code: Select all
on mouseUp
set the backGroundPattern of grc "oo" to the ID of image "tt"
end mouseUp
If you want to save storage space you can subsequently take a snapshot
of the circular graphic and delete both it and the original image.
Re: Putting image into a circle shape
Is that supposed to have a cross-hair reticule?
Re: Putting image into a circle shape
Hi Richmond,
Thanks, what I was trying to do is exactly what you have posted. I will try to use the backgroundpattern to do it. However in your post, is there a way to centralise the image so that I can fully see Donald Trump's face?
Thanks, what I was trying to do is exactly what you have posted. I will try to use the backgroundpattern to do it. However in your post, is there a way to centralise the image so that I can fully see Donald Trump's face?
Eddie
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Putting image into a circle shape
Hi,
If the human face is on the middle of your image that should work.
Best
Jean-Marc
You may try to set the rect of your img to the rect of your grc.is there a way to centralise the image
If the human face is on the middle of your image that should work.
Best
Jean-Marc
https://alternatic.ch
Re: Putting image into a circle shape
Hi Eddie,
yep, the backgroudpattern is the easy-peasy-new-york-teenie version, but has its limits like the part you will see in the pattern is alway starting at the the topleft.
To have more control of the excerpt you want to display use INKS and a group.
INKS are still a complete mistery to me but some testing revealed this solution to me:
1. Create a graphic object (oval, rect, roundrect, polygon) for your mask
2. Set it to OPAQUE and backgroundcolor to WHITE
3. Set its INK to -> BlendDestIn 4. Now group this grahic and your image and set the INK of the GROUP to -> blendSrc 5. Example of same rect for graphic and group: 6.Now you can postion your graphic inside of the group to display the part of the image you always wanted to but you need to set the rect of the group to the (new) rect of the mask graphic Have fun!
Best
Klaus
yep, the backgroudpattern is the easy-peasy-new-york-teenie version, but has its limits like the part you will see in the pattern is alway starting at the the topleft.
To have more control of the excerpt you want to display use INKS and a group.
INKS are still a complete mistery to me but some testing revealed this solution to me:
1. Create a graphic object (oval, rect, roundrect, polygon) for your mask
2. Set it to OPAQUE and backgroundcolor to WHITE
3. Set its INK to -> BlendDestIn 4. Now group this grahic and your image and set the INK of the GROUP to -> blendSrc 5. Example of same rect for graphic and group: 6.Now you can postion your graphic inside of the group to display the part of the image you always wanted to but you need to set the rect of the group to the (new) rect of the mask graphic Have fun!
Best
Klaus
-
- Livecode Opensource Backer
- Posts: 9385
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Putting image into a circle shape
If you must, you must:is there a way to centralise the image so that I can fully see Donald Trump's face?
- -
HOWEVER, as you can see, that is far from satisfactory as his cheesy muzzle
is in the centre of a non-square image, and back patterns tile.
Of course you can "fiddle around" with the Donald Trump picture outwith LiveCode
with an image editor such as GIMP so that you end up with his cheesy muzzle
in the centre of a square picture.
This does seem to be etched in stone:
The backgroundPattern of controls is drawn starting at the control's upper left corner: if the control is moved, the pattern does not shift.
Last edited by richmond62 on Sat Nov 24, 2018 4:02 pm, edited 2 times in total.
Re: Putting image into a circle shape
Eddie, no idea why you really want to fully see Donald Trump's face!?
-
- Livecode Opensource Backer
- Posts: 9385
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Putting image into a circle shape
Oh, come on, Klaus, we all have our "little kinks"no idea why you really want to fully see Donald Trump's face!?
(and I won't tell about yours if you don't tell about mine).
-
- Livecode Opensource Backer
- Posts: 9385
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Putting image into a circle shape
Why do I feel that needs a bit of clarification?setht eINK of the GROUP
Or is November 24 Metathesis Day?
Re: Putting image into a circle shape
I have nothing to hide, just go ahead!
Re: Putting image into a circle shape
Because you do not have the slightest touch of imagination?richmond62 wrote: ↑Sat Nov 24, 2018 4:06 pmWhy do I feel that needs a bit of clarification?setht eINK of the GROUP
I corrected this little faux-pas in the meantime.
-
- Livecode Opensource Backer
- Posts: 9385
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Putting image into a circle shape
Wow! That's the first time I have been accused of that.Because you do not have the slightest touch of imagination?
- - -
All stand for "Hail to the Cheese."
Re: Putting image into a circle shape
Did you notice the questionmark at the end of my first sentence?