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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:27:24+00:00 2026-05-30T06:27:24+00:00

I am attempting to put together a small game engine, in Silverlight. However, I

  • 0

I am attempting to put together a small game engine, in Silverlight.

However, I am currently stuck on a rather lower level issue: The ability to draw images, in different positions. I intend on doing this dynamically through code, as, from what I’ve seen, most everything in XAML tends to be something that is at least somewhat static.

I have changed the base ‘grid’ into a Canvas, instead, so that I could draw anywhere on it. Perhaps this was a bad idea, though, I don’t know. Any or all advice would help.

        InitializeComponent();
        Image img = new Image();
        img.Source = new BitmapImage(new Uri("Generic URL here"));
        ((BitmapImage)(img.Source)).DownloadProgress += new System.EventHandler<DownloadProgressEventArgs>(TestEventHandler);

        Rect position = new Rect(new Point(25, 25), img.RenderSize);

        LayoutRoot.Children.Add(img);
        img.Arrange(position);

My original attempt, above, was to use the Arrange function, above, to ‘move’ the image to a new position. However, I have no idea how this works, and when I did the above code, the image no longer displayed on screen.

An unrelated question: is it possible to store images with the Silverlight application, as to not have them loaded via URL? I know it likely is, but what I really mean to ask, is how I would go about that?

Thank you all for any help.

-Stefan Zuefeldt

  • 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-30T06:27:25+00:00Added an answer on May 30, 2026 at 6:27 am
    • Use Canvas insteads of Grid is a good idea. Canvas is better than Grid in case you want to change position of its children controls

    • To move the image to a point p, you can do it by:

      • add the image to the canvas
      • call Canvas.SetLeft(img, p.X) and Canvas.SetTop(img, p.Y)

    • If you want to add images to xap, you can easily add the images to project, and set build type of the images to “Content” (default is None or Resource, I’m not sure), and then using relative url: img.Source = new BitmapImage(new Uri(“/tmp.jpg”, UriKind.Relative));
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to put together a little mashup with some twitter APIs. However, the
Finally, I'm getting into OOP and attempting to put together my first class. However,
I'm attempting to put together some basic report screens. I've got some fairly complicated
I'm attempting to piece together and run a list of tasks put together by
I'm attempting to put together a generic method invoker (for a C++ OO/v8 bridge),
So I am trying to put together a small lightweight framework for some basic
I am attempting to put together a fairly complex form using dojo and dijit
We are using the GWT-Presenter framework and attempting to use CellTable to put together
I'm attempting to put together a makefile that will take source files from a
I'm currently attempting to use PHP to transfer small files between our server and

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.