How To Draw Image Or Edit Simple Lines In Text Box
Jan 8, 2013
I am wondering if there is a way to draw an image, or edit simple lines in a text box. The entire screen is a textView/ect and i would like to be able to write a sentence then draw an image and write again. By draw i think i would use the Canvas, so basically is there a way to include a canvas in a text view?
Evernote does do this, but to edit an image/draw you need to open another app "Skitch", my goal is to try and do this without any extra apps.
For example:
Hello
(canvas/editable graphical items)
World
View 3 Replies
Dec 29, 2009
what is best way to create app in which I only need to draw simple lines through onTouchEvent? When i use invalidate everytime i draw any line, that erase lines i draw before. But if I use some List structure to store drawed lines it lose performance. Is there any simple way to do it?
View 6 Replies
View Related
May 12, 2010
I thought this would be easy to find:
A text editor that can create/edit text files from the SD card.
i.e. Windows Notepad on the Desire?
View 4 Replies
View Related
Sep 10, 2010
I've got a little problem...Well, let me first state what I'm trying to accomplish. I had a spinner that pulls strings out of a stored array.
Like so, you dont need to read it though:
CODE:...........................
So far I've got a custom SimpleAdapter.
Here is the Problem!! : the text comes up but not the image. Heres the code:
CODE:........
I plan to use a switch statement to set different images to each name. however i stopped here until i can get any image to show. How i'm calling
CODE:........................
View 1 Replies
View Related
Apr 28, 2010
How to draw different types of lines like thick line, dashed line etc using opengl android?
View 6 Replies
View Related
May 5, 2010
I am having an EditText. If i specify image for the EditText in the layout XML file (android:back ground) it looks different and looks different when i specify it at runtime EditText et = (EditText)find ViewById (R.drawable .et1) ; et.setBackgroundDrawable (Main.themes.getDrawable (EDRAWABLES.EditText BackgroundImage )); Both codes point to the same image. When i specify the image at runtime , the EditText leaves a margin at the top and bottom of the cursor in the edittext which does not happen when i do it in XML. I have attached the screenshots of both images. Top image is the one drawn from XML and bottom one is given at runtime. I am not getting the difference ? Actually i am facing similar problems with other Widgets too if i change the logic of specifying the drawable at runtime and not at compile time.. Is this the default SDK behaviour? You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com /group/ android-developers? hl=enEditTextProblem.JPG
View 2 Replies
View Related
May 7, 2010
i have a customized LinkedEditText extends from EditText, and override the onDraw method as below:...........................
View 9 Replies
View Related
Sep 16, 2009
I've the following code I'm trying to run on emulator ( v 1.5 of OS), but it seems like I can't use the whole canvas! Code...
View 2 Replies
View Related
Jul 23, 2010
I am working on a paint application for Android. Now I want to implement an eraser to allow erasing parts of a loaded bitmap by using touch input and making the bitmap transparent along the finger's path.
A very good example of what I try to achieve is shown in the application Steamy Window for Android. Steamy Window simulates a fogged window, where a user can wipe parts of the fog via touch input.
UPDATE: I have posted the most important sections of my current code below. I am not really happy with it for the following reasons:
Drawing is quite sluggish. What can I improve here?
I am looking for a way to use an alpha mask in order to set the pixel transparency/alpha of the pixels as I want to simulate a paint brush. Any suggestions how this could be achieved?
CODE:...................
View 1 Replies
View Related
Aug 14, 2010
What is the simplest way to draw pixels, lines and circles on a View?I want to move a cross cursor around, so nothing particularly intensive.I thought I could extend SurfaceView and add it to an XML and it would just work, but it just appears black, however, when I look at the layout view of localmap.xml in eclipse, the graphics appear as expected. Any ideas? My onDraw is never called on the emulator, and even calling invalidate on the class makes no difference. I shall keep trying but can anyone see anything I've missed? or is there a better way entirely? Code...
View 1 Replies
View Related
Nov 11, 2010
I'm writing an app that shows in google maps pipes and valves(lines and points). For that i've two classes.
One extends from ItemizedOverlay, and i add to map overlay one for each category of valve, and each one can have more than one item.
The second extends from Overlay, and in the draw method y draw the line with the method drawline of the canvas.
The problem i've is that the lines are drawn over the ItemizedOverlay items, no matter the order i add them to the mapView.getOverlays().
I want the lines on the bottom of all overlays. is there a way to do that.
View 1 Replies
View Related
Nov 20, 2010
I tried enough to find in google & android this question. Also did several trials & errors, but couldn't get this question. was learning Android's "Draw Nine Patch" images. One basic I know is that, whatever image you process must be in .png format (if it's already in .9.png then it will be ignored by tool). However, couldn't understand what it literally means by "stretchable patches" ? what exactly happens when you draw black dots outside the .png image ? (preview pane shows changes happening, but I am unclear on how it makes those)When I draw black dots in left/top sides of image it shows some changes in preview; but why isn't there any effect when you do the same on right/bottom side of the image ? why this tool is used primarily for background, when we try to process on the image itself ?i am trying to modify a simple button.png (given in android sdk). Whenever I use this tool & draw black lines, it reduces the size of the image instead of 'stretching' it! Why ?What is the significance of options given below like, "show lock", "show content", "Patch scale" and so on ?I apologize for asking so many questions, but in Android online docs they haven't explained well for novice. If someone can answer these, it will become ready reference for all the begineers who search this forum.
View 2 Replies
View Related
Jun 21, 2010
I want to have a elmenent with a 2 color border outline. I can do a single color outline using the element, but this only allows me to draw a single line. I tried using 2 elements within my but that didnt work either. Is there a way to either draw a shape within a shape or draw 2 lines around my shape (which has rounded corners btw).
View 3 Replies
View Related
Jul 13, 2010
I am trying to put a background image and draw on top of that screen. I assumed activity will have a on draw method, but it does not have. it seems i need to use surfaceview. Can I put a surfaceview on top of the image view and make it transparent ? any example/tutorial i can refer to ?
View 5 Replies
View Related
Oct 26, 2010
In editText I set text as $ . I dont want to edit before $ symbol . i.e edit text doesnt want take any value before $ . ex: $adfdfd correctad$dsdff wrong .like this . how to restrict this one .
View 2 Replies
View Related
Nov 17, 2009
I have a problem as follows:
In my project i am having rich text editor options to apply for the edit text view. In that i applied font color,font names,font size options for user.But these options will apply for whole text available in edit text. But my problem is i want to apply user selected settings (like font color,size,font) for user selected text instead of Whole text. i want to apply the user selected font/color/size to the user selected text.How?
How to implement this .
View 2 Replies
View Related
Jul 29, 2010
I'm wondering how can I split single line text into few lines. I need it for game. I want to make it in canvas. It will be notification popup, but sometimes text is too long (I draw text canvas.drawText()), and I need to split it and draw in few lines in rows. Anyone knows a good solution? I saw methods mPaint.measureText() or TextUtils . split () , but it isn't so good in my case. Is there other method?
View 5 Replies
View Related
Sep 8, 2010
Is there any settings/flags to expand the summary text of a notification to two lines instead of 1? The text I am trying to put is too long and it goes over the visible area? Will try something like (text+"/n"+restOfText) tomorrow but I don't think it's going to work...
View 5 Replies
View Related
Dec 2, 2009
Any one know about how to draw a bitmap image?...
View 6 Replies
View Related
Mar 14, 2009
Is it possible to draw a png image and then to run opengl operations on it with android? Is this the right forum to ask this? where can i get more information on doing such stuff?
View 2 Replies
View Related
Aug 9, 2010
How do I draw a view on top of image. There is a predefined android xml file and when I run the application I would like to bring up a dot or a square on the top of image. Here the image already shows up from pulling information from andrid res folder , how to draw an dot over it.
View 2 Replies
View Related
Sep 24, 2010
I have a long text and I want it to be displayed with a TextView. The text I have is much longer than the available space. However I don't want to use scrolling, but ViewFlipper to flip to the next page. How can I retrieve the lines from the first TextView that are not shown because the view is to short so that I can paste them into the next TextView?
I simply have to use a custom View with a StaticLayout like this:
public ReaderColumView(Context context, Typeface typeface, String cText) { super(context);
Display display = ((WindowManager)
context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
dWidth = display.getWidth(); dHeight = display.getHeight();
contentText = cText; tp = new TextPaint();
tp.setTypeface(typeface); tp.setTextSize(25);
tp.setColor(Color.BLACK); tp.setAntiAlias(true);
StaticLayout measureLayout = new StaticLayout(contentText, tp, 440, Alignment.ALIGN_NORMAL, 1, 2, true);
Boolean reachedEndOfScreen = false;
int line = 0; while (!reachedEndOfScreen) {
if (measureLayout.getLineBottom(line) > dHeight-30) { reachedEndOfScreen = true;
fittedText = contentText.substring(0, measureLayout.getLineEnd(line-1));
setLeftoverText(contentText.substring(measureLayout.getLineEnd(line-1)));
} line++;
} } protected void onDraw(Canvas canvas) { super.onDraw(canvas);
StaticLayout textLayout = new StaticLayout(fittedText, tp, 440, Alignment.ALIGN_NORMAL, 1, 2, true);
canvas.translate(20,20); textLayout.draw(canvas);
}
Thats not optimized yet but you get the point.
View 1 Replies
View Related
Oct 12, 2010
Hints to draw a spot(small filled circle) on a bitmap image.
View 1 Replies
View Related
Sep 18, 2010
How can I draw margin for Image by using Rect object (I need also to change the margin color for every image), so in the end I will have a new Image that surrounded by margins.
View 2 Replies
View Related
Jul 6, 2010
My objective is to run a glowing animation on an image.I am changing the image alpha to produce this effect.
I have used basic AlphaAnimation provided in android framework but found that its slowing down other animations. So i extended a class from SurfaceView and created a thread to update it. ( Again here, i am manipulating alpha of the image ).
Everything seems fine, except that i am not able to draw a transparent image onto SurfaceView.Its showing black color on the transparent areas of the bitmap.code...
View 1 Replies
View Related
Nov 17, 2010
I have an Android TextView displaying some text, and it's multi-line. However, in the text, I sometimes have domain names; how can I stop the TextView from splitting the lines up on the periods in them?
Is there a Unicode non-breaking-period, for example?
View 1 Replies
View Related
Aug 28, 2010
I would like to know what the best way would be to draw a background image (this would be pretty much static) and a foreground object which would move depending on user input in Android?
Sort of like a side-scroller game (when the foregroudn object needs to animate and change a lot more than the background).
View 1 Replies
View Related
Jul 26, 2010
I have an EditText where users can set text to bold, italic, etc but I can't figure out how to save that text with styles as .txt file/any otherway to save it.If we save as html page we can't edit the webview. I use getText but that only returns text and no style info.
View 2 Replies
View Related
Jun 17, 2010
Anybody knows how to write upside down text of edit text in Android.
View 1 Replies
View Related
Apr 8, 2010
I want to write a short app for getting some info from contacts, the first list screen I have should display the user Image (or an Image from resources if no such image exists) an the user display name. The problem is I don't seem to find a query that will provide me with the display name and a user id And the image URI in the same query. Moreover I'm aware of the fact that if the user has no image and the URI is empty or null i will most likely to get an exception while the adapter calls setViewImage(). Is there a simple way around it or should I override the setViewImage() or bindView() methods?
Also about the query, any chance I can make a single query for contact URI, _ID, contact_id and display name? my current queries: To get the contacts:
private Cursor getContacts() { Uri uri = ContactsContract.Data.CONTENT_URI;
String[] projection = new String[] ContactsContract.Data._ID,ContactsContract.Data.CONTACT_ID,
ContactsContract.Data.DISPLAY_NAME };
String selection = ContactsContract.Data.MIMETYPE + " = ?";
String[] selectionArgs = {ContactsContract.CommonDataKinds.StructuredPostal.CONTENT_ITEM_TYPE};
String sortOrder = ContactsContract.Contacts.DISPLAY_NAME + " ASC";
return managedQuery(uri, projection, selection, selectionArgs, sortOrder); }
If I have a contact id and want the image:
int _id = m_cursor.getColumnIndex(ContactsContract.Contacts._ID);
//try to retrieve the photo, if exists.
Uri photoUri = ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI,
m_cursor.getLong(_id)); InputStream is = ContactsContract.Contacts.openContactPhotoInputStream(m_context.getContentResolver(), photoUri);
Here I get from a cursor with _ID column the id and then creating the uri, I know I can get a row number but I'm not familiar enough with contentProvider to know how to join tables to get it all in one query (if even possible).
View 2 Replies
View Related