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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:43:16+00:00 2026-05-27T07:43:16+00:00

I need to put an user control (a TextBlock in this case) in the

  • 0

I need to put an user control (a TextBlock in this case) in the horizontal center of a WriteableBitmap, here is the code that i come with so far:

textblock1.RenderTransformOrigin = new Point(0.5, 0.5);
wp.Render(textblock1, new TranslateTransform() {Y = topMargin, X = imgWidth / 2});

but it appears that the pivot point of the textblock is still at the left edge of the control, where did i do wrong?

  • 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-27T07:43:17+00:00Added an answer on May 27, 2026 at 7:43 am

    You may be transforming by the center, but the TranslateTransform moves the center the same distance as any other point. It’s like grabbing a piece of paper and moving it an inch left. It doesn’t matter where you grab it.

    Try this:

    wp.Render(textBlock1, new TranslateTransform() {Y = topMargin - textBlock1.Height / 2, X = imgWidth / 2 - textBlock1.Width / 2});
    

    You can forget about RenderTransformOrigin unless you are using rotates/scales/matrices etc.

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

Sidebar

Related Questions

I need to put a one second delay in this jQuery function so that
Here's the problem....I have three components...A Page that contains a User Control and a
I need to put a control to the right of my MenuStrip. The MenuStrip
I have a user control with several child controls. I need the user interface
In my C# Windows Forms application, I have a user control that contains other
I have an ASP.NET user control that contains a text box control and a
This is the user control which I'm working on. The items in the first
Suppose there is a user control in a page called Paging.ascx that is embedded
I have several buttons that does operations on an image. I need to put
I need to put an alpha blended gradient border around an image. My problem

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.