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

  • Home
  • SEARCH
  • 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 6077085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:40:52+00:00 2026-05-23T10:40:52+00:00

I used to be able to do so very much with just the Bitmap

  • 0

I used to be able to do so very much with just the Bitmap and Graphics objects. Now that I’ve been using WPF the only thing I seem to be able to do is load an image and show it and make it dance around the stupid screen. Why did they get rid of these very useful tools. Are they trying to stupefy .Net?

All I want to do is load an image from a file and cut it into two parts. This was easy with .Net 2.0 and System.Drawing. But with WPF, I’m hitting a brick wall without using some very low level code. I’ve tried working with WriteableBitmap. But it doesn’t seem to really be what I’m wanting. Is there no way to wrap a DrawingContext around a BitmapImage or something?

Please tell me that WPF is more than HTML for applications. I am REALLY frustrated!!

Edits:

Also, how on earth does one save an image to a file?

  • 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-23T10:40:53+00:00Added an answer on May 23, 2026 at 10:40 am

    If you want to cut the image in two parts, why not use the CroppedBitmap class?

    Consider the following XAML. One source BitmapImage shared by two CroppedBitmaps, each showing different parts of the source.

     <Window.Resources>
        <BitmapImage x:Key="bmp" UriSource="SomeBitmap.jpg" />
    </Window.Resources>
    
    <StackPanel>
        <Image>
            <Image.Source>
                <CroppedBitmap Source="{StaticResource ResourceKey=bmp}">
                    <CroppedBitmap.SourceRect>
                        <Int32Rect X="0" Y="0" Width="100" Height="100" />
                    </CroppedBitmap.SourceRect>
                </CroppedBitmap>
            </Image.Source>
        </Image>
        <Image>
            <Image.Source>
                <CroppedBitmap Source="{StaticResource ResourceKey=bmp}">
                    <CroppedBitmap.SourceRect>
                        <Int32Rect X="100" Y="150" Width="50" Height="50" />
                    </CroppedBitmap.SourceRect>
                </CroppedBitmap>
            </Image.Source>
        </Image>
    </StackPanel>
    

    Update: to do something similar in code:

            var bitmapImage = new BitmapImage(new Uri(...));
            var sourceRect = new Int32Rect(10, 10, 50, 50);
            var croppedBitmap = new CroppedBitmap(bitmapImage, sourceRect);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am very much new to the iPhone SDK. I just haven't been able
I'm pretty much just looking for the code they used that is very similar
I think this may be a very simple question, but I am only just
(First off, thanks so much. Stackoverflow has been very helpful to me in the
I've just started a new job and noticed that the analysts computers are connected
I want to build a very simple servlet that will read the http posted
I've been reading up on NLP as much as I can and searching on
I have a build script (.bat) that invokes MSBUILD ( C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\msbuild.exe ) that used
Sorry if this was covered before in some way that I wasn't able to
I'm designing a site (a customer portal) that will probably be used with mobile/touchscreen

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.