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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:25:40+00:00 2026-06-18T12:25:40+00:00

Is there faster way to do this? I have 36 different pictures, when the

  • 0

Is there faster way to do this? I have 36 different pictures, when the picture changes, i have a string that tracks the image (rotation), image1 is rotation = 1 and so on, what i have to do is use 36 if statements like this:

if (rotation == 1) //This is picture1
{

}
else if (rotation == 2) //This is picture2
{

}

all the way up to:

else if (rotation == 36) //This is picture36
{

}

Is there any way figure out what rotation it is with only like 1 or 2 lines of code?
And any who would say check before you ask, i have checked and i found nothing that would help, if you found something, please post it here.

The inside of my if statements are just for changing the image.

Thanks.

  • 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-06-18T12:25:42+00:00Added an answer on June 18, 2026 at 12:25 pm

    Either use an array

    picture = img[i];
    

    or perhaps actually name the image after the index (e.g. image01.jpg, image02.jpg etc.)

    The array strikes me as the most extensible and concise solution.

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

Sidebar

Related Questions

Is there any other method that is faster than doing like this? private void
Is there any way to optimize this piece of code to work faster? I'd
I currently use: BufferedReader input = new BufferedReader(new FileReader(filename)); Is there a faster way?
I wondering if there is a faster (GPU time) way to draw a full-screen
Is there any way to replace titles faster then str_replace function? I've got a
Is there a way to stream video with opencv faster? i'm using Mat img;
I want to ask if is there any faster method how to make this
Is there any equivalent of String.indexOf() for arrays? If not, is there any faster
I have certain code that I want to optimize. It looks like this: function
I have different applications written in C# and C++ that communicate between each other.

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.