I would like to draw bitmap image over the text that I type in editfield.
How can I do that?
You will need to subclass EditField and then override the paint method. In the override, call super.paint before you do anything so that the component can draw the text, and then you can use the Graphics object provided by paint to draw a Bitmap over the contents of the EditField (Graphics.drawBitmap).
Related
I would like to fill a TPath.Data from a TBitmap.
Delphi FMX provides a FillPath on a Bitmap Canvas:-
http://docwiki.embarcadero.com/CodeExamples/Rio/en/FMXTCanvasFillFunctions_(Delphi)
Image1.Bitmap.Canvas.FillPath(path, 200);
But I'm looking fill the Path Data from the Bitmap.
Any code examples?
tia
You mean how do you fill an enclosed TPath with a bitmap instead of a solid color. You change the Fill property to a Bitmap:
path1.Fill.Bitmap:=mybitmap;
path1.Fill.Kind:=TBrushKind.Bitmap;
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.
I can create a Cylinder
Img: TControl3D;
Img := TCylinder.Create(nil);
however Img does not seem to have a colour property. Even when I cast it as a cylinder.
It seems to be defaulting to red. Also the object inspector does not have a colour property for cylinders either.
Each 3D shape object has MaterialSource property - use it to give your shape color/texture.
If you want to set shape material to solid colour, use TColorMaterialSource component, set color that you want, and link it to the shape's MaterialSource property.
I want to place solid border and border color to the EditField in blackberry when it is focused.Hers is my screenshot http://www.mediafire.com/imageview.php?quickkey=yst9bgev9crqjny&thumb=4.Please help
Override onFocus and onUnfocus methods in your field class.
And draw colored rectangle around input field area.
I want to create a bitmap CGContext with the same color space as an existing CGContext.
How can I get the UIColor space of a CGContext?
You need to call CGBitmapContextGetColorSpace to get the colour space of a given bitmap context,
but if you're talking about a general context then the question isn't well defined because CGContexts have two colour spaces: stroke and fill.