Is there anyway to remove the black border from a TColorbutton ? Delphi xe5, developing for iOSdelp
There are actually three black or gray borders.
First, add a custom stylebook to your app. The docwiki tells how to do this:
http://docwiki.embarcadero.com/RADStudio/XE5/en/Customizing_the_Design_of_a_FireMonkey_Application
Follow step #2 (Step 3 doesn't work for mobile applications.)
Open the style editor and locate ColorButtonStyle.
Expand the tree node and click on "background" in the structure.
In the object inspector locate Fill and expand that node.
Change the fill Kind to bkNone.
That removes the wide gray bordered, leaving two dark gray 1px borders.
Further down the list of properties just below Sides is Stroke.
Change it's Kind to bkNone. That removes the outer gray line.
Depending on your app you may need to also edit the color animations below the background rectangle. I did this by erasing (blanking out) the triggers since I was unable to delete the animations.
Next go the Fill component and set the stroke kind to bkNone. That removes the inner gray line.
You may also also want to set the Fill Margins to 0 so the color extends to the outside of the object. (i.e no padding now that the gray is not there.)
Gary
Related
I often need to add text to an image. To do this, I use the Text Tool. When I click on the image, I can start filling in the text. However, the box that the text is in always shows up as transparent. There are times where this is good, but many times I want black text on a white box. How can I set the color of the box the text is inside?
You can just bucket fill the layer (no selection) after putting the bucket tool in Behind mode. But this makes the text layer no longer a text layer (text and font information is lost).
So a better solution is to add a layer under the text later and bucket-fill, with two options:
Make a layer the right size (when you create the layer it takes by default the side of the active layer) and bucket-fill the whole layer
Make an image-size layer, make a rectangle selection and bucket-fill the selection
Note that bucket-filling the text layer (or a layer which is the exact same size) usually won't look good because the boundaries of the layer come from the font geometry (so you can stack/abut layers) and there is a lot more space on top and bottom than on the sides.
I'm trying to make assign colors to individual segmented lines using ROI Manager. Every time I make a selection and change the color in properties, the line reverts to its original color as soon as I click back on my image. How can I assign colors to individual lines and get them to stick? Thanks
If you drop a FMX.TStringGrid onto a new FireMonkey form, the grid gets shown with a thin border.
If you drop a FMX.TTListView onto the form, there is no border.
Neither component seems to have a property for enabling/disabling the border, or setting the border colour or width.
I assume this is due to the cross-platform requirement, so how should it be done? Do I need to add a panel, then put the listview inside the panel? Or is it something to do with the style, as in needing a TStyleBook?
Yes, the TListView has no border. Firemonkey offers several ways to add a border to any visual control. For adding a simple border I would not try to change the styles.
In my opinion, the simplest solution is to put a rectangle from the palette (from Shapes) into the form.
Set in the rectangle the Stroke to the desired color and thickness.
As the next step, go to the structure-view in the designer and move the Listview as a child element into this rectangle. Change the Align property of the listview to Client.
To display the border-lines again, you must set all the values for Padding (bottom, left, right and top) of the rectangle to the value thickness of the rectangle stroke.
If you like you can also add a TShadowEffect on your rectangle or listview control.
Is ShapeRenderer class has the ability to do this,I would like to create boundaries for a custom object (such as a rectangle with rounded corners) and then fill it.And after that some text on that filled rounded box.
shapeRenderer.begin(ShapeType.Filled);
shapeRenderer.setColor(Color.RED);
//shapeRenderer.line(...);
shapeRenderer.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments);
shapeRenderer.line(...);
shapeRenderer.curve(...);
shapeRenderer.line(...);
shapeRenderer.curve(...);
shapeRenderer.line(...);
shapeRenderer.curve(...);
shapeRenderer.setColor(Color.BLACK);
shapeRenderer.fill();
shapeRenderer.end();
Any suggestion to do it in libgdx.
As Lestat said, you can use Scene2d.
Whether you are using Scene2d or not, a NinePatch would probably be suitable if you want to draw a rounded rectangle that scales well (check this link).
If you want to be able to set the color of your image/control, you can use NinePatch.setColor().
Here are two example scenarios regarding colors:
You will always have a black stroke/outline, and an arbitrary fill. In this case make the original image have black stroke/outline and white interior. When you 'tint' the image using NinePatch.setColor(), the stroke/outline will be unaffected and will remain black, while the interior (fill) will be the same as the color provide to the mentioned method.
You have arbitrary fill and arbitrary stroke. In this case you need 2 separate original images. First one would contain the 'fill' and would be completely white. Second one would contain the 'stroke' in white color and would be transparent inside. When drawing you would draw first the fill with its tint and then the stroke with its tint and that's all.
If for some reason you needed different corner curve radii, you would probably need separate images (or image pairs) for each radius to get the best result.
Wondering if there is an easy way to remove a rectangular slice across the entire width of an image using Gimp, and have the resulting hole closed up automatically. I hope that makes sense. If I select a slice across an image and do "cut", it leaves a blank "hole" there. I want the new top and bottom of the image to join and fill that hole, reducing the image height by the amount sliced out.
Any easy way to do this?
Here is a method that is quick and often does what you want:
Cut out the middle, leaving a transparent "hole".
Click anywhere to remove the selection (so the hole is not selected).
Click Image > Zealous crop .
This is going to remove the middle part. However, if you also have transparency in other parts of the image (like around the edges) it's going to remove that transparency too.
I believe you're asking to do something like cut out the middle of a page, leaving the header and footer and have the blank space removed with the cut action, effectively joining the header and footer together.
To my knowledge, I don't believe so. Even if you cut, or delete, that space is still part of the image even without content.
But, you would be able to highlight the top or bottom (or left or right) of the remaining space and drag it to align with the other side. It's not ideal for repetitive tasks, but should get you through if you only have to do it a few times.
Install Python and the Python Imaging Library. Back in GIMP, select and cut the full-width areas you don't want to transparent, and export the image to test.png. Then use this Python code (works only if complete lines are transparent; will not work properly if there are 100%-transparent pixels anywhere other than on a full-width row)—
from PIL import Image
i = Image.open("test.png")
b = i.tobytes()
b2 = ''.join(b[n:n+4] for n in xrange(0,len(b),4) if ord(b[n+3]))
newHeight = len(b2)/i.width/4
i2 = Image.frombytes('RGBA',(i.width,newHeight),b2)
i2.save("test.png")
Then re-load test.png and verify that the areas you cut have gone.
In gimp 2.8.1 you can easily create a new image from a selection. So if you select a rectangular than do a copy (Ctrl-C) and a past in a new image
Edit -> Paste as -> new image (or Ctrl-Shift-V).