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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:24:41+00:00 2026-06-06T23:24:41+00:00

I have to write functions which is setting pixel in WPF. I need to

  • 0

I have to write functions which is setting pixel in WPF. I need to draw some pictures. Using attached code I have some blurry effect (like on screen).

Can you tell me what is wrong, or which methods I should use ?

namespace DisplayAppCS {

public partial class MainWindow : Window
{

    WriteableBitmap _bitmap = new WriteableBitmap(100, 200, 1, 1, PixelFormats.Bgr32, null);

    public MainWindow()
    {
        InitializeComponent();
        image1.SnapsToDevicePixels = true;
        image1.Source = _bitmap;

        int[] ColorData = { 0xFFFFFF }; // B G R

        Int32Rect rect = new Int32Rect(
                1,
                60,
                1,
                1);

        _bitmap.WritePixels(rect, ColorData, 4, 0);

    }
}}

pixel blurry effect

  • 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-06T23:24:43+00:00Added an answer on June 6, 2026 at 11:24 pm

    Your bitmap is 100×200 but your window is much larger. Your image is being stretched to the size of the window, thus creating the “blurring” effect. You need to either change the size of the window or tell the image not to stretch:

    <Image Stretch="None"/>
    

    That said, you could be going down completely the wrong path using a writeable bitmap. It really depends on your requirements. Could you get away with just using built-in WPF shapes, for example?

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

Sidebar

Related Questions

I'd like to write a function that would have some optional code to be
I am trying to write some code to optimize some Open GL functions for
If you have a C function which returns an integer, you could write a
I have a function that I use quite frequently, which allows me to write
I'm trying to write a functions to modify strings in C. If I have
I have designed a MIPS I simulator using Verilator which allows me to wrap
I am using MPI2.2 standard to write parallel program in C. I have 64
I have this following code fragment which is accessed by different threads. try {
I have a program which interfaces with a radio I am using via a
I have a function which will take student details as input and write their

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.