Monthly Archives: June 2009

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

A little delayed but still here!

While we are waiting for my entries I can say a little about what I have planed. The first artickel will be about image straightening. I have a working solution but I am not complete satisfied so maybe we can improve it together. I will always be open for suggestions about improvements and better way of doing stuff. I am not claiming to be a pro and lot of my solution will be based on what others have contributed.

Recently I have done some gradient variants I would like to share with you so keep on coming back. Have you ever wanted to include resizable thumbnails in your application? I have a solution and I will share it with you. It was a lot easier than I had imagined so there is no excuse for not adding it any longer… well untill you have read my artickel that is.

Working with colors have always been a little difficult and I have had to ask around sometimes. This has given me some good solutions and I planning to show you my solutions. 

This is a little about what is comming.  I hope you find it intresting and if you have any comments please tell me.

My idea of this site is to be a helping hand in graphics programming in Delphi. Finding solutions and contribute to finding solutions that  works.

 

Kind regards

Roy Magne Klever