Posts

Showing posts with the label C#

Swelio 1.6 released

Swelio 1.6 is available for download . This release includes bugs fixing based on the users feedback. Thanks to Tom Pester and Tim Messiaen for useful comments. The new version of this blog is available on  https://perevoznyk.wordpress.com

Swelio 1.5 - Freeware Belgian eID card SDK

Image
The new release of Swelio - freeware Belgian eID card SDK is available for download . Whats new in this release: * Fixed some bugs in C++ code * Updated C++ documentation * Added Delphi documentation * Added Microsoft .NET binding The C# source code of the .NET binding included. The library supports AnyCPU, x86 and x64 projects. It is compatible with .NET Framework 2.0 - 4.5 and tested with all Windows versions starting from Windows XP. The provided assembly was compiled for .NET Framework 2.0 using Microsoft Visual Studio 2008, but the project can be easily upgraded to the more recent versions of the .NET Framework and Visual Studio. It was done to cover more possible configuration, because the downgrade of the Visual Studio project is not possible. The sample project is also provided. Please leave your comments or write a review to help me improve the quality and functionality of the Swelio SDK. If you found a bug - please report it to me using the contact form . The...

EIDNative library version 3.0 is released

EIDNative - the Belgian eID card access library version 3.0 is available for download. Now it supports x64 and x32 Windows and can be used from Windows XP to Windows 8. This is the last release of the EIDNative library and it will be not updated in the future, because I made the new more advanced and powerful library for reading electronic id cards and the new library will replace EIDNative. The new version of this blog is available on  https://perevoznyk.wordpress.com

Quricol 2.0 - QR Code generator

The version 2.0 of Quricol - the open source freeware QR code generator library is available for download.  Download :  https://github.com/perevoznyk/quricol Based on qrencode library version 3.4.2 Added Visual Studio project file and external libraries for easy rebuild of quricol.dll. This was asked by  Carlos Gutierrez Added possibility to specify the background and foreground colors of the image Removed reference to qrencode.h from quricol.h header file. Now you have to include only one header file to your C++ project Updated Delphi library, included new demo project Compatible with Ansi and Unicode Delphi versions Can be used with 32 and 64 bit Delphi projects Updated Delphi documentation

Krento becomes Open Source

The time has come for KRENTO to be released as open source .You can find the source code on Google Code site: https://code.google.com/p/krento After 4 years of hard work I understood that I can't continue the development of such a big project alone. I hope that other developers will show the interest of giving the boost to this project. More information about Krento project is available on http://users.telenet.be/serhiy.perevoznyk/krento.html

New release of Quricol

The new version of Quricol library is available for download. Download :  https://github.com/perevoznyk/quricol Update from 07.05.2012 The error correction level is changed to high.

Quricol - QR code generator library

Image
Quricol is an open source freeware QR code generator library for C++, Microsoft .NET and Delphi based on qrencode - QR Code encoder by Kentaro Fukuchi.The library contains methods to save the generated image to Bitmap or PNG file or generate images on-fly and save it to the stream. Both 32 and 64 bits compiled versions available along with source code. Download :  https://github.com/perevoznyk/quricol A QR code (abbreviated from Quick Response code) is a type of matrix barcode (or two-dimensional code).

Generate Excel files without using Microsoft Excel (Part 2)

After publishing my article on CodeProject I received a lot of questions how to change the font, alignment or color of the cells in the resulting Excel file. I improved the code of the ExcelWriter library and added the possibility to format cells. You can download the new release of the ExcelWriter library here: http://users.telenet.be/serhiy.perevoznyk/download/XLSExportDemo.zip Update from 31 Jan. 2012: This code is provided to show the possibility of easy export of the information to Excel files, not to manipulate existing Excel files or performing the complex formatting operations. The aim of this demo is to make the export easy and simple. In case if you do more complex tasks I can recommend to use another library, for example http://www.smartxls.com/index.htm. I do not have any plans to extend the provided code in the future. namespace XLSExportDemo { class Program { static void Main(string[] args) { ExcelDocument document = ...

Code 39 barcode in C#

Some time ago I published the EAN 13 barcode generator source code. Now in addition to it made I simple Code 39 generator. using System; using System.Collections.Generic; using System.Text; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; namespace Karna.Barcode { public class Code39 { static readonly string star = "*"; private Image image; private string barcodeId; private int width; private int height; public Code39(Image image) { this.image = image; this.width = 210; this.height = 146; } public int Width { get { return this.width; } set { this.width = value; } } public int Height { get { return this.height; } set { this.height = value; } } public string BarcodeId { get { return barcodeId; } ...

Windows Magnification API .NET

Image
The Magnification API provides assistive technology vendors with the means for developing screen magnification applications for Windows Vista and later operating systems.The API enables you to display a simple control that magnifies a specified portion of the display by a specified factor. Images as well as text are displayed. Unfortunately, Microsoft provided only native C++ API functions without .NET equivalent, so I decided to make a simple .NET wrapper in C#. The full C# source code is available for download: http://users.telenet.be/serhiy.perevoznyk/download/Magnification.zip   The magnification class is based on native Windows API calls. Here is a small excerpt from the library sources: using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; namespace Karna.Magnification { internal static class NativeMethods { public const string WC_MAGNIFIER = "Magnifier"; [DllImport("user32.dll...

The classic Tetris game as Windows Forms control

Image
This is just plain old Tetris, written in C# and implemented as a Windows Forms control,  so you can insert it in your own .NET application. I assume you have played Tetris before and know the rules of this simple but interesting game. Download full source code: http://users.telenet.be/serhiy.perevoznyk/download/Karna.Tetris.zip

Simple EAN - 13 barcode generator

Here is a very simple EAN - 13 barcode generator written in C#. using System; using System.Text; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; using Karna.Barcode.Properties; using System.Globalization; namespace Karna.Barcode { public class Ean13 { private string barcodeId; private Image image; public Ean13(Image image) { this.image = image; } public string BarcodeId { get { return barcodeId; } set { if (value == null) return; if (value.Length != 13) { throw new ArgumentException("Wrong data length"); } barcodeId = value; string s = null; string[,] encTable = new string[3, 10]; int[,] parityToEnc = new int[10, 8]; parityToEnc[1, 2] = 0; ...

How to verify Certificate Revocation using EIDNative library

This example receives the raw certificate date from eID card, then convert the raw data to X509Certificate and uses X509Chain for certificate validation. using System; using System.Collections.Generic; using System.Linq; using System.Text; using EIDNative; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; using System.IO; namespace Certificates { class Program { static void Main(string[] args) { byte[] rawCertificate; X509Certificate2 certificate; X509Certificate2 caCertificate; X509Certificate2 rootCaCertificate; X509Certificate2Collection certs; EIDCard card = new EIDCard(); card.InitReader(); if (card.IsEIDCard()) { rawCertificate = card.ReadAuthenticationCertificate(); if (rawCertificate.Length > 0) { certs = new X509Certificate2Collection...

Resampling images in Compact Framework

Image
Resizing the image with good quality result is not simple task in CF, because Graphics InterpolationMode property is not supported. For breaking this limitation I developed a new library with the resampling engine made in C++ for ARM processors and a very simple C# wrapper for it. The engine implements a lot of buit-in filters with different speed and result quality. Download: http://users.telenet.be/serhiy.perevoznyk/download/Karna.Compact.Resample.zip The result of the resampling: The original image dimensions 256x256 and resampled image 48x48 Download: http://users.telenet.be/serhiy.perevoznyk/download/Karna.Compact.Resample.zip Note: When using this library you must distribute Resample.dll with your application. Thanks to Carlo Pallini's for his idea of C++ resampling library.

Write Date value in ExcelWriter

People asking me how to insert the date value into Excel coulmn, but as a date, not just as a text in my C# ExcelWriter class. I extended this class and added 2 additional methods:  public void WriteFormat(string value)  public void WriteCell(int row, int col, DateTime value, int formatIndex) // C# ExcelWriter class v1.1 // by Serhiy Perevoznyk, 2008-2009 using System; using System.Collections.Generic; using System.Text; using System.IO; namespace XLSExportDemo { /// <summary> /// Produces Excel file without using Excel /// </summary> public class ExcelWriter { private Stream stream; private BinaryWriter writer; private ushort[] clBegin = { 0x0809, 8, 0, 0x10, 0, 0 }; private ushort[] clEnd = { 0x0A, 00 }; private void WriteUshortArray(ushort[] value) { for (int i = 0; i < value.Length; i++) writer.Write(value[i]); } /// <summary> //...

Read SIS card from .NET application

Image
Here is a simple smaple of reading SIS card data using EIDNative library from .NET application. using System; using System.Collections.Generic; using System.Text; using EIDNative; namespace SISCardReader { class Program { static void Main(string[] args) { EIDCard eidCard = new EIDCard(); eidCard.InitReader(false); if (eidCard.ReadSisId()) { Console.WriteLine("name: " + eidCard.SISIdentity.Name); Console.WriteLine("first name: " + eidCard.SISIdentity.FirstName); Console.WriteLine("initial: " + eidCard.SISIdentity.Initial); Console.WriteLine("sex: " + eidCard.SISIdentity.Sex); Console.WriteLine("birthdate " + eidCard.SISIdentity.BirthDate); Console.WriteLine("social security number: " + eidCard.SISIdentity.SocialSecurityNumber); Conso...

LCD Label WinForms Control

Image
Here is my new small WinForms control: LcdLabel. LCD Label control simulates the well known Alphanumeric dot-matrix LCD displays, commonly used on lot's of electronic equipments. Download full source code

Karna .NET v.1.0. official release

Karna .NET 1.0 is available for download from http://sourceforge.net/projects/karna

Info-ZIP C# wrapper article at Codeproject

Many of today's applications require the capability of extracting certain files from a ZIP archive, either onto the hard disk or into memory. A lot of useful zip libraries for .NET applications abound on the Web ( SharpZipLib for .NET Framework is a very known one), but I wanted to use the Info-ZIP library as it was always my favorite library for C++ projects. Info-ZIP is an Open Source version of Phil Katz's "deflate" and "inflate" routines used in his popular file compression program, PKZIP. Info-ZIP code has been incorporated into a number of third-party products as well, both commercial and freeware. It offers two dynamic link libraries: one for zipping, and one for unzipping. The Info-ZIP DLLs are free to use and distribute, but they are designed to be used in C/C++ projects, so they're not really .NET-friendly. Also, the Info-ZIP package contains almost no documentation showing how to use the Info-ZIP DLLs. Therefore, I decided to write a sm...

Karna .NET: new release and new forum

The new beta release of Karna .NET is available for download . As usual the full source code + new samples are available . In this release the new Karna.AddIn namespace is introduced. Now Karna supports AddIns technology for making modular applications. Other news: I created new forums related to Karna .NET project Please visit http://apps.sourceforge.net/phpbb/karna These forums will be the preferable support way for Karna .NET Also all announcements for the new releases will be moved from my blog to Karna forum