How to C#: Imaging
Using Imaging SDK for C#.NET
Winforms Controls
Image Load
Load Image
Image Access and Modify
Load Image
  |  
Home ›› XImage.Raster ›› C# Raster: Load Image

How to C#: Load Image Using XImage.Raster


Overview for How to Use XImage.Raster to load raster image in C# .NET Programming Project




RasterEdge XImage.Raster has provided five ways to create raster image object that are load from file, load from stream, load from url, load from bitmap and clone raster image from object.


Related .net document control helps:
asp.net pdf editor: EdgePDF: ASP.NET PDF Editor Web Control: Online view, annotate, redact, edit, process, convert PDF documents
asp.net annotate pdf: ASP.NET Annotate PDF Control: annotate, comment, markup PDF document online using ASP.NET C#
asp.net mvc document viewer: ASP.NET MVC Document Viewer: view, annotate, redact files on ASP.NET MVC web projects
asp.net pdf viewer: ASP.NET PDF Viewer Control: view, navigate, zoom Adobe PDF document in C# ASP.NET
asp.net excel web viewer: ASP.NET Excel Viewer in C# Control (MVC & WebForms): view Office Excel document in web browser.
sharepoint document viewer: ASP.NET SharePoint Document Viewer: view, annotate, redact documents in SharePoint
asp.net ppt viewer: ASP.NET PowerPoint Document Viewer Control (MVC & WebForms): view ppt, pptx files online in C# using ASP.NET


The site Advanced Load Options has explained how to use the loading options. When loading image from to RasterImage object, if the parameter LoadOptions was not set, XImage.Raster SDK will load the image according to the default load option settings. read pdf file line by line using vb.net, add watermark to pdf using itextsharp c#, vb.net itextsharp add image to pdf, open pdf in word c#, barcode reader project in c#.net, c# tiff reader. That is, if you don't have any special needs, or don't know how to preset the load options, you can load image from file with the default load options whether it is PNG/BMP such a single frame image or GIF/TIFF such a multi frame image.




Load Image from file Using C#



You can load image from file using the codes as follows. itextsharp insert image into pdf vb.net, c# convert pdf to svg, word automation services sharepoint 2013 convert to pdf c#, c# remove text from pdf, vb.net read pdf file, convert pdf to html c# online, c# pdf add background.


Sample Code (load image with default load option)




RasterImage img = new  RasterImage(@"C:\input.jpeg"); 




Sample Code (load image with load option)




//use specified load option load image from file
LoadOption option = new LoadOption();
option.LoadAlphaChannel = false;
option.Resize = new Size(100, 100);
//load image from file according to specified load options
RasterImage img = new RasterImage(@"input.jpeg", option);





Load Image from Stream Using C#



With the XImage.Raster SDK, you can load image from a memory or filestream. While, you can load a single frame image or multi frame image in the same way. You can load image from stream as follows.


Sample Code(load image from file stream with default load option)




//load image from stream without load options
FileStream fs = new FileStream(@"input.jpeg", FileMode.Open,  FileAccess.Read);
RasterImage img = new RasterImage(fs);




Sample Code(load image from file stream with load option)




/load image from stream with load options
FileStream fs = new  FileStream(@"input.jpeg", FileMode.Open, FileAccess.Read);
LoadOption option = new  LoadOption();
option.LoadAlphaChannel = false;
option.Resize = new Size(100,  100);
RasterImage img = new RasterImage(fs,  option); 





Load Image from Bitmap or DIB Using C#



With the XImage.Raster SDK, you can load image from System.Drawing.Bitmap or DIB data to the RasterImage object.


Sample Code (load image from bitmap with default option)




//load image from bitmap without load options
RasterImage img = new RasterImage(bm);




Sample Code (load image from bitmap with option)




//load image from bitmap with load options/
LoadOption option = new LoadOption();
option.LoadAlphaChannel = false;
option.Resize = new Size(100, 100);
RasterImage img = new RasterImage(bm, option);