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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:21:25+00:00 2026-06-04T14:21:25+00:00

I have raw data in a custom image format (canot be changed) that is

  • 0

I have raw data in a custom image format (canot be changed) that is stored in column major order (after some binary header data). I read the file into a Byte[] called “imageDataBytes”.

int XSize = 1280; // Really the height of the image
int YSize = 2048; // Really the width of the image
WriteableBitMap myImage = new WritableBitmap(XSize, YSize, 96, 96, PixelFormats.Gray16, null)
System.Windows.Int32Rect rect = new System.Windows.Int32Rect(0, 0, XSize , YSize);
myImage.WritePixels(rect, customImage.imageDataBytes, stride, customImage.imageOffset);

Now, I show this in XAML with

    <Image Grid.Column="0" Grid.Row="1" Cursor="Cursor1.cur"Source="{Binding myImage}" Stretch="None"/>

I need to get the image rotated (to correct for the column major order in the bytestream but I can’t find array transformations for the Byte[] similar to IPPs in C# (and I don’t have IPP available here). And The rotation of the image from xaml moves the image all over the place (rather than rotating around the center).

<Image ... // From above>
    <Image.RenderTransform>
        <RotateTransform CenterX="0.5" CenterY="0.5" Angle="-90"/>
    </Image.RenderTransform>
</Image>

What can I do? Am I missing the transforms on the byte[] somewhere? Why is the RotateTransform moving the image when the center is set to 0.5?

Note that this must be as fast as possible, it is clearly a large image and I am trying to render at 10Hz+, this is why the nieve for-loop Byte array transformation is excluded from the realm of possible.

Thanks as always

~TMII

  • 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-04T14:21:27+00:00Added an answer on June 4, 2026 at 2:21 pm

    That’s because you are not rotating about the object’s center but about the point (0.5, 0.5).
    See http://msdn.microsoft.com/en-us/library/system.windows.media.rotatetransform.centerx.aspx

    If you have access to the image in the code behind, set the RenderTransform manually, and specify the CenterX and CenterY as Image.Width/2.0 and Image.Height/2.0.
    You only need to do this when the image changes.

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

Sidebar

Related Questions

I have created a custom Server control that processes some data, stores that data
I have a sheet full of some raw data, about 20,000 rows and 50
I have a C program that mines a huge data source (20GB of raw
I have a raw image buffer in the RGB format. I need to draw
I have a raw form-data that look like this: ------------V2ymHFg03ehbqgZCaKO6jy Content-Disposition: form-data; name=intro O
We have a large raw data file that we would like to trim to
I have flv files that contain audio tags with a aac raw data. Each
I have different CSV files and these files have some raw data Computer Name,Computer
I have a process that reads raw data and writes this to a database
I have raw data that looks as follows: I want to perform a T-SQL

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.