⌘BABAKOV.NET Let's code!
100% [light] [ru]
~/tags/c $

#C#

85 posts

85 total · page 8 / 9

How to Open Images in C#

From the archive - might come in handy... It seems there's nothing simpler than opening an image from disk in C#. But, there are some pitfalls! Here are two examples. The first method (incorrect): if (openFileDialog1.ShowDialog() == DialogResult.OK) {…

97 views 0 comments 0 likes ./Read →

Changing Image Size in C#

From the archive - might come in handy... Often when adding images to a project, you need to change the image size, and often you want to do it properly, with the image proportions preserved. Personally, I often need to insert images into a ListView and shrink them correctly (so they don't spread out in a square of the specified size). This is exactly where the procedure below will help. <br><br>Size change procedure:

105 views 0 comments 0 likes ./Read →

Enabling Vibration in Windows Mobile on C#

Archive - may be useful to someone Most modern phone models support the vibration alert function, so it can be used (for example, in games when explosions occur to add more realism, or when writing communication programs, to notify the user of incoming messages while the device is in a pocket).

16 views 0 comments 0 likes ./Read →

Example of Converting a Color Image to Black and White in C#

There may be many methods for converting a color image to black and white, and possibly even more advanced ones, but for now, the method presented below is the fastest among the ones I know. The conversion uses only standard libraries. The method's essence is not to work with the image itself, but to work with a block of data. If simplified, it's just freezing the image data in memory, modifying it as needed, and returning it to its original state.

103 views 0 comments 0 likes ./Read →

Conditional Compilation in C#

I once had a task to compile a program for different devices. A range of devices in my case have specific capabilities and use special libraries, while for some ordinary devices, these libraries need to be excluded. Of course, you can comment out each time, but there are many inclusions and this approach is quite problematic.

36 views 0 comments 0 likes ./Read →

Working with Excel from C# (archive)

This is the simplest and most primitive example, may be useful, but better to use OpenXML. In this publication, an example of creating and displaying an Excel document from a program written in C# is presented. The most primitive example is presented for educational purposes.

27 views 0 comments 0 likes ./Read →