Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6003377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:06:46+00:00 2026-05-23T01:06:46+00:00

I have a drawing app where the user can draw lines with their finger,

  • 0

I have a drawing app where the user can draw lines with their finger, adjust the color, thickness, etc. As the user is drawing, I am converting the massed X/Y points from MotionEvent into SVG Paths, as well as creating Android Path’s and then drawing the Android Path’s to the screen via a Canvas, and committing the SVG Path’s to the app’s database.

I am following the model used in FingerPaint, in that the ‘in progress’ lines are drawn on the fly by repeated calls to invalidate() (and thus, onDraw()), and once the line is complete and a new line is started, the previous line(s) are drawn in onDraw() from the underlying Canvas Bitmap, with in progress lines again generating repeated re-draws.

This works fine in this application – until you start rotating the underlying Bitmap to compensate for device rotation, supporting the ability to ‘zoom in’ on the drawing surface and thus having to scale the underlying Bitmap, etc. So for example, with the device rotated and the drawing scaled in, when the user is drawing, we need to scale AND rotate our Bitmap in onDraw(), and this is absolutely crawling.

I’ve looked at a SurfaceView, but as this still uses the same Canvas mechanism, I’m not sure I’ll see noticeable improvement… so my thoughts turn to OpenGL. I have read somewhere that OpenGL can do rotations and scaling essentially ‘for free’, and even seen rumors (third comment) that Canvas may be disappearing in future versions.

Essentially, I am a little stuck between the Canvas and OpenGL solutions… I have a 2D drawing app that seems to fit the Canvas model perfectly when in one state, as there are not constant re-draws going on like a game (for instance when the user is not drawing I don’t need any re-drawing), but when the user IS drawing, I need the maximum performance necessary to do some increasingly complex things with the surface…

Would welcome any thoughts, pointers and suggestions.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T01:06:47+00:00Added an answer on May 23, 2026 at 1:06 am

    OpenGL would be able to handle the rotations and scaling easily.

    Honestly, you would probably need to learn a lot of OpenGL to do this, specifically related to the topics of:

    • Geometry
    • Lighting (or just disabling it)
    • Picking (selecting geometry to draw on it)
    • Pixel Maps
    • Texture Mapping
    • Mipmapping

    Also, learning OpenGL for this might be overkill, and you would have to be pretty good at it to make it efficient.

    Instead, I would recommend using the graphic components of a game library built on top of openGL, such as:

    • Cocos2d
    • libgdx
    • any of the engines listed here
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a vector drawing app where users can draw lines using multiple quadratic
We have an HTML5 drawing app where users can draw lines using a pencil
I have a silverlight app on an MVC page that user's can draw on,
I made a simple drawing app with which I can draw lines on a
I have an app that in a certain Activity (drawing) can be in any
Hi I am trying out drawing app and have a problem when it comes
I am making a drawing app for iOS and I have the following classes:
I have a simple OpenGL drawing. When the user changes the window's size, I
I have created a painting app and when the user want's to save his
Say, for an iOS app, if a user slides his finger on the screen,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.