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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:21:28+00:00 2026-06-16T01:21:28+00:00

I have a array of pixels (m_pixels) that I want to render to the

  • 0

I have a array of pixels (m_pixels) that I want to render to the screen using Direct2D.
The array contains 10,000 elements (100 rows of 100 pixels). The code below loops over the pixels and draws them to the screen as 10×10 rectangles. Is there a more efficient way of performing this operation? How can I add a GaussianBlur effect to the pixels/image?

m_d2dContext->BeginDraw();
m_d2dContext->Clear(ColorF(0.0f, 0.0f, 0.0f));



// Render m_pixels
// m_pixels is updated by the solver directly before render
auto rect = D2D1_RECT_F();
ComPtr<ID2D1SolidColorBrush> pBlackBrush;
DX::ThrowIfFailed(m_d2dContext->CreateSolidColorBrush(ColorF(1.0f, 0.0f, 0.0f),&pBlackBrush));

for (int i=0; i<10000; i++){
    //Update the color
    pBlackBrush->SetColor(D2D1::ColorF(m_pixels[i]*3, m_pixels[i], m_pixels[i]));
    //Update the rectangle size
    rect.top = 10*floor(i/100);
    rect.left = 10*floor(i%100);
    rect.bottom = 10*floor(i/100) + 10;
    rect.right = 10*floor(i%100) + 10;
    //Set the rectangle color
    m_d2dContext->FillRectangle(rect, pBlackBrush.Get());
}

HRESULT hr = m_d2dContext->EndDraw();
  • 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-16T01:21:29+00:00Added an answer on June 16, 2026 at 1:21 am

    Try using ID2D1RenderTarget::CreateBitmap() and ID2D1RenderTarget::DrawBitmap()

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

Sidebar

Related Questions

I have an array that contains the RGB colour values for each pixel in
I have an array of graphs, that are 2000x1000 pixels pngs. When I put
Very simple question... I have an array of pixels, how do I display them
I have array of strings, String[] data and it's 10 elements has value P
I have an array of N measurements that I should present as a graph,
I have a high-resolution image that I want to use as a tiled map
I have array with colors as its objects. I want to create an image
I have an array of images (can be up to 25) that need to
Using C++ and .net I have a stream of data I want to display
I have a rather large, almost full screen image that I'm going to be

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.