Code Monkey home page Code Monkey logo

bryximageviewer's Introduction

BRYXImageViewer

An Image Viewer for use in C# projects, particularly for Windows 10 applications

Example

Usage

IMPORTANT: Change the class in the xaml to be apart of your project, not the BryxImageViewer project!

Add the BryxImageViewer.xaml and BryxImageViewer.xaml.cs files to your project. In the example project, I added them to a controls folder that lives in the main project directory. Also, add the styles that live in the App.xaml file to your project's App.xaml. This will allow for the styling of the ContentDialog and the Button to look correctly. The button style is not needed. In fact, any styling can be used for it, but the ContentDialog styling is needed in order for then image to take up the whole dialog and for the dialog to operate correctly.

If you added it to a controls folder, you can import the folder by having xmlns:controls="using:BRYXImageViewer.Controls" in the topmost tag of your page:

<Page
    x:Class="BRYXImageViewer.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:BRYXImageViewer"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:controls="using:BRYXImageViewer.Controls"
    mc:Ignorable="d">

Then, in the rest of your xaml, you can put <controls:BryxImageViewer></controls:BryxImageViewer> There are two requried properties when using this control: ImageSource and ThumbnailSource. In the example I just used the same picture, but some may want to use a shrunken-down version of the main image at a specific size.

You can also add the Foreground property to the tag, and it will apply that color to the X button used for closing the image.

To close the image, you can either tap the image or tap the X button.

An example use of this in a page would look like this:

<controls:BryxImageViewer Margin="5" Foreground="Black"
                          ThumbnailSource="http://beginners-investing.com/images/learn-how-to-invest.jpg"
                          ImageSource="http://beginners-investing.com/images/learn-how-to-invest.jpg"/>

Requirements

The example project as well as the control requires Windows 10

Author

Robert Bond, [email protected]

License

BRYXImageViewer is available under the MIT license. See the LICENSE file for more info.

bryximageviewer's People

Contributors

rjb8682 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bryximageviewer's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.