Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Loading image to Stackpanel

Loading image to Stackpanel

Scheduled Pinned Locked Moved WPF
tutorialquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pix_programmer
    wrote on last edited by
    #1

    Hi! I've added a Scrollviewer(Horizontal) to my screen. Inside this scrollviewer I've added a stackpanel. I want to add images one after other into this stackpanel. How to add images to the stackpanel?

    A 1 Reply Last reply
    0
    • P pix_programmer

      Hi! I've added a Scrollviewer(Horizontal) to my screen. Inside this scrollviewer I've added a stackpanel. I want to add images one after other into this stackpanel. How to add images to the stackpanel?

      A Offline
      A Offline
      Abhinav S
      wrote on last edited by
      #2

      Try

      <StackPanel Height="140" Orientation="Horizontal">

      </StackPanel>

      Here[^] is an example on how to use the Image control. You can also consider other controls like a ViewBox[^] instead of a StackPanel. A ViewBox provides inbuilt transform capabilities.

      P 1 Reply Last reply
      0
      • A Abhinav S

        Try

        <StackPanel Height="140" Orientation="Horizontal">

        </StackPanel>

        Here[^] is an example on how to use the Image control. You can also consider other controls like a ViewBox[^] instead of a StackPanel. A ViewBox provides inbuilt transform capabilities.

        P Offline
        P Offline
        pix_programmer
        wrote on last edited by
        #3

        Abhinav S wrote: You can also consider other controls like a ViewBox[^] instead of a StackPanel Is it scrollable. I want horizontally scrollable pictures. For that I've added a Scrollviewer inside which I've added a StackPanel. Inside this StackPanel I've to add pictures and implement Horizontal Scrolling. Is this possible with ViewBox?

        A 1 Reply Last reply
        0
        • P pix_programmer

          Abhinav S wrote: You can also consider other controls like a ViewBox[^] instead of a StackPanel Is it scrollable. I want horizontally scrollable pictures. For that I've added a Scrollviewer inside which I've added a StackPanel. Inside this StackPanel I've to add pictures and implement Horizontal Scrolling. Is this possible with ViewBox?

          A Offline
          A Offline
          Abhinav S
          wrote on last edited by
          #4

          pix_programmer wrote:

          Is it scrollable

          No. A viewbox can stretch to the size of the image. You can define the width / height of the viewbox to allow a scroll.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups