Tag Archives: Delphi

Showing thumbnails part #2

In part one I showed you how to show thumbnails in one predefined size, now it is time to take it to the next level. I show you how to make realtime resizable thumbnails.

Thumbs demo

Screenshot of thumbnails demo

The trick to make it work is to use an additional  list of bitmap thumbnails. Thumbnails is still kept as jpegs in the items list. The diffrence between previus version and this one is that when rendred to screen they are converted to bitmaps and cached in a bitmap list. This makes screen update faster and more pleasent.

I use a cache size of one point five the screensize but you can set it to whatever you want.

rkView has been updated so it is recommended that you recompile the package where you installed the rkView.

Enough said download the code and see for yourself. Enjoy and have fun!

Download: Thumbnails demo

Showing thumbnails part #1

I have split the thumbnail project into to parts. In part one, this one,  I will show you how to view thumbnails the easy way using rkView.

rkView is just like a virtual grid view, no data is stored inside it.  rkView was made to ease the task of viewing tumbnails but are not in any way limited to this task.  I also use this component as a ownerdraw listview. So go ahead an install this component (it is included in the download).

Screenshot of Thumbs demo

Screenshot of thumbnails demo

Showing thumbnails using rkView is an easy task all we need is a list of thumbnails and some code to draw it. rkView will call the ‘OnCellPaint’ event for each cell, giving us a canvas to paint on.

In this demo I have chosen to store the thumbnails as jpeg since it occupies less space than using bitmaps.

Well it is time to download and run the code.

Download: Thumbnails demo

My TBX themes

I made my tbx themes available here today. For those of you not knowing what tbx is, TBX stands for toolbar extension and was written by Alex A Denisov and is an extension to Toolbar2000 by Jordan Russell (www.jrsoftware.org)

Some of my themes have been updated like the Xito and Dream theme. I do not have the old ones so backup your copy before trying the new ones, just in case you like the old one better.

Download: Themes

How do you straighten an image in Delphi?

I have always wondred of how they do this magic… straighten an image that is. Well as it turns out, no magical skills is needed. All that is needed is to crop the rotated image.

One question, I have not found a fully acceptable answear to yet, is how to calculate this area. My solution uses the four rotated corners of the image. This works and is acceptable but it loses more than needed of the image when the angle increases.

Image straighten demo

I have included a demo project that shows my solution. Do take a look at it and if you find any bugs or improve it in any way, I would love to hear about it.

Download: Demo including source