Git Product home page Git Product logo

thumbnailsgenie's Introduction

ThumbnailsGenie - C# thumbnails/icons library

ThumbnailsGenie is a library that generates thumbnails from images and several other file types (e.g. pdf, doc, xls). Images are resized and other file types are given proper, nice looking icon.

File icons are embedded into assembly so the library is suited for the server usage. It does not use any windows explorer API.

Install NuGet

Add To project via NuGet:

  1. Right click on a project and click 'Manage NuGet Packages'.
  2. Search for 'ThumbnailsGenie' and click 'Install'.

Examples

Get icon for mime type

using ThumbnailsGenie;

...

var icons = new IconThumbnail();

var pngIcon = icons.GetThumbnailForMimeType("image/png", Thumbnails.Size.Px512);
var jpegIcon = icons.GetThumbnailForMimeType("image/jpeg", Thumbnails.Size.Px48);
var bmpIcon = icons.GetThumbnailForMimeType("image/bmp", Thumbnails.Size.Px32);
var tiffIcon = icons.GetThumbnailForMimeType("image/tiff", Thumbnails.Size.Px16);
var gifIcon = icons.GetThumbnailForMimeType("image/gif");
var blankIcon = icons.GetThumbnailForMimeType("blank");

Get icon for extension

using ThumbnailsGenie;

...

var icons = new IconThumbnail();

var pdfIcon = icons.GetThumbnailForExtension("pdf", Thumbnails.Size.Px512);
var docIcon = icons.GetThumbnailForMimeType("doc");
var docIcon = icons.GetThumbnailForMimeType("exe");
var javaIcon = icons.GetThumbnailForMimeType("java");

Get image thumbnail

using ThumbnailsGenie;

...
var ms = new MemoryStream();

using (var imageStream = new FileStream("pic.jpg", FileMode.Open, FileAccess.Read, FileShare.Read))
{
  new ImageThumbnail(imageStream, Thumbnails.Size.Px512).SaveToStream(ms);
}

thumbnailsgenie's People

Contributors

grzegorzblok avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

thumbnailsgenie'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.