This is a preview version of Cyotek's blog and may be missing functionality and/or unstable. Please visit for the current version of the blog.
If you encounter any problems using this preview site, please contact us with the details.

Archived posts for All of 2012

ImageBox and TabList update's - virtual mode, pixel grid, bug fixes and more!

c# winforms imagebox TabList 12 Comments Downloads

Our last post before the new year and some new material is an update to the ImageBox (now at version and TabList (at version controls. You can grab the updated source from the links at the end of the post, or from the GitHub page.

Happy New Year all!

Read More

Manually writing the byte order mark (BOM) for an encoding into a stream

c# encoding stream binarywriter getpreamble 0 Comments

I recently discovered a problem with our WebCopy and Cyotek Sitemap Creator products to do with "corruption" of plain text documents, where non-ANSI characters appeared incorrectly. It didn't take long to realize that these programs were saving text content as ANSI files. Which I found curious as Crawler library they use detects response encoding and uses this to save the files.

Or does it? Consider the code below:

Read More

Assembly Reference Scanner Sample

0 Comments Downloads

Due to an issue with our setup programs, certain files weren't getting updated if the version numbers hadn't changed. This led to crashes if you upgraded from one version to another. I wrote this tool as part of my diagnostic into why the programs were crashing complaining of wrong version numbers. It uses a reflection load only context to scan all assemblies in a folder, and checks each assemblies references against each other to ensure the versions match.

Note: This tool doesn't support assemblies in the GAC, only references to assemblies deployed in a folder. It is also a tool wrote in a hurry to solve a particular problem and may not fit your needs without modifications.

Read More

Extracting email addresses from Outlook

c# interop com outlook email office 0 Comments Downloads

The receives an awful lot of spam and a lot of this is sent to email addresses that don't exist. However, as we currently have catch all's enabled, it means we receive it regardless. This is compounded by the fact that I tend to create a unique email address for each website or service I interact with. And it's impossible to remember them all!

As a first step to deleting the catch alls, I wanted to see how many unique addresses were in use. The simplest way of picking up these would be scanning PST files - we have email going back to 2002 in these files, and there's the odd backup elsewhere going back even further. Last time I used OLE Automation with Outlook was back in the days of VB6 and I recall well getting plagued with permission dialogs each time I dreamed of trying to access the API. Still, I thought I'd take a look.

Read More

ImageBox update, version

c# winforms zoom imagebox scrollablecontrol 14 Comments Downloads

The ImageBox control has had quite a big update, you can download the source from the link below, or from our GitHub page.

Listed below are the changes made during this update, we hope you enjoy them!

Read More

Zooming to fit a region in a ScrollableControl

c# zoom imagebox scrollablecontrol 0 Comments

I suspect the titles of these last pair of articles are a touch misleading as they talk about extended zoom operations without actually describing a zoom process (as this is already part of other ImageBox articles. Unfortunately I can't really think of better titles and the theory is generic enough to be applied to any type of zooming, not just the ImageBox.

My previous article touched on zooming in a ScrollableControl while keeping the content correctly aligned to a fixed point, usually the mouse position prior to the zoom. This article expands on that with another new feature in the upcoming ImageBox update, zooming to a given region. You've probably seen this behaviour in other paint programs, where you select a Zoom tool, draw a rectangle, and the document is automatically zoomed to fit.

Read More

Zooming into a fixed point on a ScrollableControl

c# zoom imagebox scrollablecontrol 0 Comments

If I'd built subtitle support into the CMS that powers this website, then surely the subtitle would have been "or how I fixed that annoying zoom bug in the ImageBox control". And with that digression out of the way, onto the article, a nice and short one for a change!

I should probably point out that this article doesn't describe how to actually do any zooming (as that is dependant on what it is you are actually doing a zoom upon), but rather how to keep the viewport focused on a given point after zooming. To learn about zooming, please see previous articles that describe the ImageBox control in detail.

Read More

Creating a multi-paged container control with design time support

c# winforms ParentControlDesigner ScrollableControlDesigner verb design-time TabList 3 Comments Downloads

This article describes adding design time support for a TabControl-like component which renders the same way the Project Properties in Visual Studio 2012.

This is the first time I've tried to make more advanced use of component designers so there are going to be areas that I'm not aware of or have not implemented correctly. The component seems to be working fine, but it's entirely possible that bugs exist, which could cause problems. Caveat emptor!

Read More

Displaying the contents of a PDF file in an ASP.NET application using GhostScript

c# image pdf ghostscript convert 3 Comments Downloads

After receiving quite a few requests on making the PDF image conversion work in a web application, I wanted to see how hard it would be to do. Not hard at all as it turns out, I had a nice working sample running with a bare 5 minutes of work.

The sample available for download below is a basic ASP.NET application, comprised of a single page with an IHttpHandler for displaying the image. In order to make this sample as easy as possible, it uses pure server side controls and code, nothing client side.

Read More

Arcade explosion generator

c# winforms game image graphics imagebox arcade explosion generate 0 Comments Downloads

Over the past few weeks I've been messing around creating a unique graphics for our Jewel Rush game. One of the things I was experimenting with was explosion animations. Although tools exist for generating explosions the problem with most of these is that they create large sprites which don't shrink well, and the output is a bit more realistic than what I was looking for.

And while I'm competent enough to do application graphics (more or less!), gaming graphics are a completely different kettle of fish!

Read More