Yesterday I uploaded the archives with compiled packages for XE for SMExport and SMImport (both registered and trials)
Category: Soft/Programming
-
Parser for ePub files (e-book)
Today I finished the component to parse the e-books in .epub format:
http://en.wikipedia.org/wiki/Epub
I added this parser in SMWord suite Also I added this file format to Fast Document Viewer and ABA DocConvert
-
C#: generate image thumbnail
//create the thumbnail int image_width = 96; int image_height = 96; Image imgThumbnail = imgOriginal.GetThumbnailImage(image_width, image_height, null, IntPtr.Zero); //save to file imgThumbnail.Save(Path.GetDirectoryName(AFileName) + @"\a2.bmp", ImageFormat.Bmp);
or
private bool ThumbnailCallback() { return false; } private void ProcessImage(Image imgOriginal) { //create the thumbnail int image_width = 96; int image_height = 96; Image.GetThumbnailImageAbort myCallback = new Image.GetThumbnailImageAbort(ThumbnailCallback); Image imgThumbnail = imgOriginal.GetThumbnailImage(image_width, image_height, myCallback, IntPtr.Zero); //save to files imgThumbnail.Save(Path.GetDirectoryName(AFileName) + @"\a2.png"); } -
C#: random file name
string path = Path.GetRandomFileName();
-
C# and MS SQL Server: add System.Drawing assembly
Working with images in SQL Server 2005 is not easy because the System.Drawing.dll is not included in the assemblies with SQL Server.
This library was not added because it does not pass the CLR Verifier, and it has not been fully tested in SQL Server hosted environment (i.e. it could damage the stability and security of SQL Server). Careful consideration should be taken when attempting to manipulate images (or even load images from a file system or webservice).
To add the System.Drawing.dll assembly to SQL Server use the new create assembly statement. The database you are adding this assembly to must have its TrustWorthy property turned on. The following code demonstrates how to add System.Drawing.dll to the ImageGen database.
ALTER DATABASE yourDatabase SET TRUSTWORTHY ON GO CREATE ASSEMBLY [System.Drawing] FROM 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll' WITH PERMISSION_SET = UNSAFE GO
Now a managed stored procedure can be created that uses the System.Drawing.dll assembly as shown below (although do not forget to add the assembly reference in the VS project).
using System; using System.Data; using System.Data.SqlClient; using System.Data.SqlTypes; using Microsoft.SqlServer.Server; using System.Drawing; using System.Drawing.Imaging;
-
C#: password characters for property in Property Grid
To not show your passwords in plain text on a propertygrid, just use the PasswordPropertyText attribute:
[DisplayName("Password"), Category("Authentication"), PasswordPropertyText(true)] public string Password { … } -
C#: image to byte array
private byte[] ImageToByteArray(Image img) { // stream to save the image to byte array Stream ms = new MemoryStream(); img.Save(ms, img.RawFormat); // read to end byte[] imgBytes = new byte[ms.Length-1]; ms.Position = 0; ms.Read(imgBytes, 0, imgBytes.Length); ms.Close(); return imgBytes; } -
ShareIt: new control panel
ShareIt сегодня запустили уже всем свою новую контрольную панель (v7.0).
Может я и консерватор, но старая мне больше нравилась. Если бы они еще какой-то новый функционал прикрутили, я бы понял. А так просто изменили весь GUI. По сути старое дерево навигации запихнули в меню+выпадающие окошки. Пока первое впечатление скорее отрицательное…
-
Protected Storage Viewer
Today I added the possibility to view the storages of Internet Explorer 7.x/8.x