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 7016215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:45:20+00:00 2026-05-27T22:45:20+00:00

I have an android application. I want to use OpenGL to render my images

  • 0

I have an android application. I want to use OpenGL to render my images and add effects. also I want a separate view where user can scribble on. I want the background color of the view to be transparent. I also want to zoom in and out as I zoom in or out the image. I am thinking I shall control the zoom in and out using glScalef(). But I shall also need to increase the pen width as I zoom (scale up) the view. I want to write this view in openGL. I am new to android and openGL. please guide me with your ideas.

  • 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-27T22:45:21+00:00Added an answer on May 27, 2026 at 10:45 pm

    I have tried a different approach to implement my functionality of scribbling over a glSurfaceView and simultaneously be able to zoom in and zoom out. I have done all the scribbling over normal android provided canvas. In the background I have a GLSurfaceView. On top of it i have a scribbble view (http://www.java2s.com/Code/Android/2D-Graphics/Classforthescribblememopad.htm). I have set the background of ScribbleView as TRANSPARENT. When I am done Scribbling I put scribbling off using onClickListener of a Button (when scribbling is off user can zoom in and zoom out). I can zoom in or out using ScaleGestureDetector.SimpleOnScaleGestureListener. In its onScale() I am using mScaleFactor=(mScaleFactor * detector.getScaleFactor()); Where mScaleFactor is initlised to 1f and mScaleFactor is used to track the current ScalingFactor. For scaling of glSurface I use glScalef(mScaleFactor,mScaleFactor) and for canvas scaling I use canvas.scale(mScaleFactor,mScaleFactor,getWidth()/2,getHeight()/2). I have set the pivot point to middle of the view as the coordinates of the canvas is such that its origin is at top left.
    After I scale up or scale down the canvas Then for correct scribbling I have in onTouchEvent(Event event) of Scribble view I have done the below mapping for the

    event.getX() and event.getY(). <br>
    x=(event.getX()- getWidth() / 2) / getmScaleFactor() + getWidth() / 2;<br>
    y=(event.getX()- getWidth() / 2) / getmScaleFactor() + getWidth() / 2;<br>
    <br>
    

    Now when I do scribbling on the zoomed in or out canvas I can scribble at the point where I touch the screen correctly.
    I hope I have been able to give you all some insight of my approach.

    Thanks Krishna.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an android application showing coverflow animation.I want to use view extending surfaceview
I have an android application and web-server working together. Now I want user log
I want to create an Android application where a user can create an account
I have a problem with facebook user login in my android application. I want
i made android application. In application i have web view where i want to
I have an Android application with a Spinner and want to fill it dynamically
I have an android application and while switching between two activities I want to
I have been developing Android application for Android 3.x and now I want to
I am developing an android application in which i have a local database.I want
i have a problem with my Android Application. The Error occures when i want

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.