I just uploaded The Photo Frame Program to the website. I use this program to copy digital photographs to my digital photo frame. The Photo Frame Program automatically scales the photos for my frame's native resolution.
By default, .NET scales Bitmaps quickly and less attractively. The Photo Frame Program performs high quality image scaling. Look at the SmoothingMode, PixelOffsetMode, CompositingQuality, and InterpolatingMode properties below:
using (Graphics gr = Graphics.FromImage(scaledBitmap))
using (Brush blackBrush = new SolidBrush(Color.Black))
{
gr.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
gr.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality;
gr.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
gr.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
if (addMarginsCheckBox.Checked)
{
// Fill entire image with black.
gr.FillRectangle(blackBrush, new Rectangle(new Point(0, 0), new Size(maxWidth, maxHeight)));
}
int xPos = 0;
int yPos = 0;
if (addMarginsCheckBox.Checked)
{
xPos = (maxWidth - scaleSize.Width) / 2;
yPos = (maxHeight - scaleSize.Height) / 2;
}
// Draw scaled image into bitmap
gr.DrawImage(originalBitmap,
new Rectangle(xPos, yPos, scaleSize.Width, scaleSize.Height),
new Rectangle(0, 0, originalBitmap.Width, originalBitmap.Height), GraphicsUnit.Pixel);
}
You can also browse this program's source code on-line.
| Title | Date |
| Node.js + Express: How to Block Requests by User-Agent Headers | January 7, 2026 |
| Vault 3 is Now Available for Windows on ARM Machines! | December 13, 2025 |
| Vault 3: How to Include Outline Text in Exported Photos | October 26, 2025 |
| .NET Public-Key (Asymmetric) Cryptography Demo | July 20, 2025 |
| Raspberry Pi 3B+ Photo Frame | June 17, 2025 |
| EBTCalc (Android) Version 1.53 is now available | May 19, 2024 |
| Vault 3 Security Enhancements | October 24, 2023 |