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

Handling the orientation EXIF tag in images using C#

c# exif jpg orientation 0 Comments Downloads

Two weeks ago I received an interesting support ticket from a user of our ImageBox control, stating that when being used for .png files, the control was absolutely file but when used with .jpg files that had been rotated using Windows Explorer shell context menus, they were displayed in the original orientation.

As soon as I read the ticket I had a hunch what was going to be the ultimate cause, and was able to quickly reproduce the problem and then confirm my hunch.

Read More

Frustrations of third party software

2 Comments

No detailed blog post, just a screenshot that neatly echo's my ongoing frustration with Resharper. It was a lot longer than 7 seconds too...

Read More

New option in Visual Studio 2019 keeps console window open after debugging

3 Comments

For as long as I've been writing console applications, I've at the end of Main I've always had a piece of code to require user input before exiting when in debug mode, in order to review any output before the window closes. Not an onerous task, but one I immediately do as soon as creating a new application.

Today I created a new .NET Core console application in Visual Studio 2019 preview and added by code without a second thought.

Read More

Reading cookies from Internet Explorer

c# interop webbrowser InternetGetCookieEx cookie 0 Comments Downloads

In order to work around cases where it wasn't possible automatically authenticate with a website, I wanted the ability to use an embedded Internet Explorer window for manual authentication and then reuse the cookies. This article describes how to read cookies indirectly using InternetGetCookieEx or directly from a WebBrowser control.

The InternetGetCookieEx Win32 API can be used to read cookie name value pairs for a given URI. You can use it to read all cookies or a named cookie. You can also specify which type of cookies to include.

Read More

Using message filters in Windows Forms applications

c# winforms pinvoke IMessageFilter 0 Comments Downloads

For a utility application, I wanted to add an item in the system menu. It's been quite a long time since I last did this (and was in VB6), so I decided to find some ready made source code. This class provides a nice little helper for wrapping the system menu to add new commands to it, but it requires the owner form to hook into its window procedure and forward messages on which...

Read More

Tools we use - 2018 edition

tools 2 Comments

Happy New Year! While once again it's that time for the list of software products and services I personally used throughout the previous year, it's also a birthday of sorts - this year will be the 10th year since Cyotek was reactivated after being shut down and also since I started blogging for the first time.

Very little change from previous years, this may change as I force myself to move to .NET Core.

Read More

Checking if your Windows Forms applications are ready for .NET Core 3.0

windows forms wpf .net core 2 Comments

Since the recent announcement that .NE Core 3.0 would support Windows Forms, I've been cautiously optimistic. Over the last week or so I've finally started experimenting with ASP.NET Core 2.1 and liking what I see (mostly, I haven't made my mind up with Razor Pages yet!).

A couple of days ago Microsoft made another announcement - a tool to scan your existing Windows Forms / WPF applications and see if how much of the API's they use are supported by Core 3.0.

Read More

Upgrading a SVN repository using VisualSVN Server

svn upgrade visualsvn svnadmin 0 Comments

Although I use Git for anything open source we produce, all other code is still in a SVN repository. I use VisualSVN Server for the server side things. When upgrading it last week to the latest version, it mentioned that Apache SVN 1.10 had new compression options and it occurred to me that while I've upgraded working copy formats before, my SVN databases are probably still using whatever format they were created at. This artic...

Read More

Working with CorelDRAW Palettes part 2, writing .pal files

c# color rgb color palette cmyk coreldraw 0 Comments Downloads

In my previous article, I described how to read an archaic CorelDRAW! 3.0 palette file. This continuation covers how to write files in this format.

Just like reading the file, writing is also a simple enough process.

Read More

Working with CorelDRAW Palettes part 1, reading .pal files

c# color rgb color palette cmyk coreldraw 0 Comments Downloads

I recently picked up a copy of CorelDRAW! 3.0 from eBay which came on two CD's with a different version on each. That gave me two different surprises, the first in that 3.0A wasn't an improved version of 3.0, and secondly instead of the .cpl format I was expecting to find, there were two different .pal formats, one text based (for CorelDRAW!) and one binary (for PHOTO-PAINT! (very shouty this software!)). This first article covers reading the text based palette format.

The palette format itself is simple enough, from the example colours below we can infer that each colour entry is in CMYK format with the range 0-100. Although it looks as if it is a fixed width format, when looking at other palettes using this format this isn't the case and columns can be of differing widths.

Read More