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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:51:40+00:00 2026-06-15T02:51:40+00:00

I do not know java (usually write in c) How can I do efficiently

  • 0

I do not know java (usually write in c)

How can I do efficiently some way of blitting
pixel array content onto a window in java?

I need (in loop) blit pixels[][] onto a window

I could use something like

 pixels[][] -> MemoryImageSource -> Image -> drawImage 

but creating and deleting MemoryImageSource and Image
in every frame seems strange to me – how it can be
done simply and reasonably efficiently? Could someone
give a code example, tnx

  • 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-15T02:51:42+00:00Added an answer on June 15, 2026 at 2:51 am

    Normally in Java it’s easier to work with the native Image types and use their derived graphics. Behind the scenes Java uses blits as well, so the higher level abstractions is made to easen the workload.

    But if there’s no way to abstract on the pixel data you can use Raster and WritableRaster (where you can replace portions of the array) as an alternative to your solution. These rasters can be used with a BufferedImage which then can be drawn using the drawImage method you mentioned. I found one way of doing it here which basically creates the Image and then retrieves the raster for future manipulation.

    int x, y = 100;
    BufferedImage image   = new BufferedImage(x, y, BufferedImage.TYPE_INT_RGB);
    WritableRaster raster = image.getRaster();
    

    That raster (or just small areas of it) can then be manipulated and repainted.

    This might improve performance slightly since the distance from you pixel-array to the screen is shorter. But I think very few people fully understands the entire depths of the AWT api – and it all depends on the native implementations of course – so my idea contains a healthy part of speculation 😉
    But I hope it helped..

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

Sidebar

Related Questions

Why in java (I dont know any other programming languages) can an identifier not
I have some java components that sometimes die and the only way I know
I know abstract fields do not exist in java. I also read this question
As we know, in Java, method name is not sufficient to distinguish different methods.
I am still not so familiar with interfaces in Java. I know that interface
I was wondering why in java constructors are not inherited? You know when you
As we know , there are a lot of java decompiler tools which can
when i am loading some data into my java program, i usually use FileInputStream.
I know Java ok, but not heavy. I am trying to get SchemaSpy working
I usually work with .NET WinForms but now have to work on some Java

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.