AlexLL
AlexLL

Reputation: 195

Proportional image size changing without quality decreasing in TImage

I have TImage 800x600 with image 1024x768. TImage aligns to alClient. Timage is proportional. TImage is streched.

When I resize the form, the image resizes too, but it's quality makes lower and the visible text labels on the Image shrinks, makes unreadable, or even after load big image into small TImage, I have the same problem.

How I can resolve that? How resize image in TImage with quality where text still readable in any normal size?(e.g. 1024x768 resized to 500x400, and text still readable in it).

Upvotes: 1

Views: 1433

Answers (2)

adlabac
adlabac

Reputation: 416

TImage resizing is not perfect. I prefer to keep the original image in the memory, and to use, say, bicubic resizing when needed (or bilinear for shrinkink). Once you resized the image just draw it to the TImage on the form.

Always keep the original image in the memory, and discard the resized one from the memory once you draw it.

Upvotes: 2

David Heffernan
David Heffernan

Reputation: 612884

You cannot hope to resize raster graphics and maintain high quality text. Text is rendered to a specific resolution. Any resampling will destroy the quality of the text. The only way to maintain high quality text through a resize operation is to re-render the text at the new resolution. One way to achieve that is to use a vector graphics format rather than raster. Another way is to be able to re-create the text on the fly.

Upvotes: 3

Related Questions