How to zoom images loaded in TImage control in Delphi XE2 Trial? - delphi

I have developed a small utility to load different types of image files in TImage control in Delphi XE2. Now I would like to implement and test zooming functionality, with built-in controls only (i.e. not using any 3rd party component).

See the second part of this answer which zooms in and out a TImage by using the mouse wheel.
Note: It repositions the image component.

Related

Windows Preview Handler using FMX drawing functions?

I have created an FMX graphics application that draws various graphics from a custom binary vector file format. I'd now like to create a Windows Preview Handler to support that file format. I have already created a basic VCL preview handler based on the code found here. Some minor fixes were needed to get it to build in Delphi 10.4. I have also added a TPaintBox that I can draw to using the VCL TCanvas drawing functions.
The problem is that all the drawing for my file format is using FMX and uses several functions that don't exist in VCL, such as colour gradients and opacity. Is it possible to somehow mix in FMX TCanvas code for the preview handler?
If not then I have another option, but I'm not sure how well it would work. I would add functionality to the FMX application such that executing it with the appropriate input parameters (file path and dimensions) would generate an image file. The preview handler would just need to call it and load the image to display it. This would mean that the preview handler could be VCL only and would also reduce code size by not replicating the drawing code, but there may be latency issues.
I could also potentially use GDI+ or Direct2D in a VCL application since it would also support the advanced drawing functions, but it would mean rewriting all the drawing functions and I'm not sure if it would look exactly the same.
Any ideas are welcome. Thanks.

Delphi cutting glass

I'm using Delphi XE2, and I like glass effects, and I want to "cut" glass as in Windows 7 tablet tools.
If you also know how cut a button I'll be happy if you tell me how.
Thanks
Drawing in the top area is simply a matter of using a glass frame and painting in the non-client area, or alternatively, using the DwmExtendFrameIntoClientArea API.
The best code sample I have seen for this is the VCL "Ribbon" control, which provides a "QAT" (quick Access toolbar) area, painted in the "non client area".
Note that the author has to think not only about how to render when Vista/Win7 systems which have Glass ON, but also has to decide how to render on WinXp, Win7 and Vista when the Themes engine is off. There is quite a bit of logic in the Vcl.Ribbon.pas (or just Ribbon.pas if you're in XE or earlier) unit dedicated to that.
Look at procedure TCustomRibbonQuickAccessPopupToolbar.NCPaint(DC: HDC); in the Vcl Ribbon sources.
Drawing a non-rectangular "extended area" that protrudes from the bottom is probably a matter of applying a custom window clipping region.
Did you mean you want shaped forms? If so
Irregularly shaped forms
could help. I imagine this will work on Windows 7 (note Remy's comment in the answer).
hth

What's the difference between ListView and GestureListView?

What's the difference between ListView and GestureListView? Examples would be helpful.
the TListview is a VCL control, based in the windows listview, this component is for general use and supports different visualizations (styles) like report style, lists, small icons, etc.
by the other hand the TGestureListView is a TCustomListView descendant which was made to display the name of gestures and a small thumbnail with the gesture’s shape.

Delphi: image with alpha blending capabilities

Is there some simple component that could display PNG 32-bit images and alpha-blend it to another image on mouse enter and on mouse leave? Or even just a simple image that can load 32-bit PNG and additionally would have Alpha parameter...
I suppose I could use some skin library (alphacontrols?) or some graphics library, but for some simple purely visual effects that would be quite an overkill and I can't seem to find a simple one that does it for me and would work on Glass surface as well...
It is not quite a component, but here is a link to a good article on how to do it yourself. Its just a few lines of code:
http://melander.dk/articles/alphasplash/
The basic TImage is capable of displaying a PNG image and alpha-blend-it to whatever is behind it. You just need to add the "pngimage" unit to the uses clause of your form. You didn't mention the version of Delphi you're on: Delphi 2010 has this unit, but I have no idea with what version of Delphi they started shipping it. For Delphi 7 I know for sure you'll need to find the open source "pngimage".
If you need to do this when the user moves in and out of your control, consider caching the state images in bitmaps: it will be faster at runtime and you can use a single TImage that shows the current image, you don't need two overlapping TIMage controls.

Looking for a simple graphical component for Delphi

I am looking for a graphical component in Delphi winch have such features:
allows to paint text in different font types, sizes and colors
allows to select previously drawn text and copy it
paints images on a given coords, gif support would be nice
its very fast in terms of CPU usage
I need this component as a main chat window. I don't want to use it as a text editor.
I've tried two solutions so far:
TVirtualStringTree
THtml
Currently I am using THtml. It performs quite nice but it is a bit to slow due to two facts:
It supports many features which are not necessary in my case
Each time I want to add some content to it, I must reload the whole content
I really don't want to go into its sources and modify them until I have no other choice. So maybe someone of you knows some nice lightweight component which I can use instead?
Take a look at TRichView. It's derived from TCustomControl so no external dependencies. It's third party commercial component, but a very good one. Skype Win client uses it.
What about a TRichEdit? Most of the things you mention should be easiliby possible with this component.
Concering the insertion of a bitmap, see this article on Delphi 3000.
Did you consider using TWebBrowser?
At least it ticks all your boxes...

Resources