Results 1 to 4 of 4

Thread: How to add image inside the canvas using SilverLight

  1. #1
    Join Date
    Sep 2010
    Posts
    47

    How to add image inside the canvas using SilverLight

    Hello everyone, can anyone help me out here? I am having some problem in SilverLight, as I am making one canvas with some images within it but I am not quite actually able to do that. Actually in drag and drop application, It must be able to place images inside the canvas, it is working that manner, but when I am trying to place some images outside the canvas it should be directly gone in to canvas, I think there must be mistake in coding, can any help me out with this? Every help will be appreciated. Please help me guys it is my college project and very stuck in these things. Thanks a lot in advance.

  2. #2
    Join Date
    Nov 2009
    Posts
    1,340

    Re: How to add image inside the canvas using SilverLight

    Hey I have seen your post, but I am able to get your exact doubt what you are trying to ask. But as per your some sentences I can understand that, and I have one solution for you. Just do some work on margin properties of an image, I mean set a negative left margin to your any desired image, and then put it too upper side, so that it will appear outside canvas when it is the part of canvas itself. I think you might trying to add images to canvas thru image control or adding it to background of canvas, you can also do that by using ImageControl event. Just try it and see is your problem is getting solved or not. All the best for your project.

  3. #3
    Join Date
    Nov 2009
    Posts
    877

    Re: How to add image inside the canvas using SilverLight

    Hey I have gone through your post, I think I know what you want and I have some coding for your coding part of canvas which will help you to fix your problem. Following code may help you:
    <Grid x:Name="LayoutRoot" Background="White" AllowDrop="True" Drop="photopanel_Drop" DragEnter="photopanel_DragEnter">
    This code calls the same events for grid for canvas, using this it will add the image of canvas only, and I think your problem will get solved

  4. #4
    Join Date
    Feb 2008
    Posts
    624

    Re: How to add image inside the canvas using SilverLight

    Hey don’t worry, when I was studying in college I have also suffered from this kind of situation. So be cool and I am giving you some event handler try those I think it will be very useful for you in future also. Following are the event handler:
    • DragEnter,
    • DragLeave
    • DragDropTarget
    • PanelDragDropTarget,
    • ListBoxDragDropTarget

    This event handler will sort out your problem regarding canvas, you just have to wrap PHOTOPANEL canvas with a PanelDragDropTarget and add Drop, DragEnter event to PanelDragDropTarget it will help you to change border color of canvas. All the best!!!

Similar Threads

  1. How to save canvas as jpeg image file?
    By lUcCIlLA in forum Windows Software
    Replies: 4
    Last Post: 27-07-2011, 11:08 PM
  2. Convert 2D image into 3D image using Silverlight 4
    By Thenral in forum Windows Software
    Replies: 5
    Last Post: 18-04-2011, 10:45 AM
  3. Folder icons not showing small image inside it
    By Mast Maula in forum Operating Systems
    Replies: 3
    Last Post: 14-03-2011, 04:39 AM
  4. Inserting image inside the php code
    By garfield1 in forum Software Development
    Replies: 3
    Last Post: 03-12-2009, 02:00 PM
  5. Canvas inside JSplitPane
    By MAHAH in forum Software Development
    Replies: 4
    Last Post: 04-11-2009, 11:53 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,581,743.82667 seconds with 17 queries