Home > Back-end >  How to manage the Delphi7 TImage. Canvas background transparent
How to manage the Delphi7 TImage. Canvas background transparent

Time:09-21

I wrote a small program, which USES four completely overlap TImage control, simulation of four layers (similar to the concept of Photoshop layers), the different layers with different content, there are two problems:
1, how to set up a TImage canvas, to ensure that the background is transparent;
2, after clear how to ensure that the background to transparent;

CodePudding user response:

1, put a Panel set up its size and location;
2, put in a Panel, four Image stacked together,
Image4 & lt; - the top
Image3
Image2
Image1 & lt; - the bottom

3, set up the Image attributes:
Image4. Transparent:=True;
Image4. Stretch:=True;
.
Image1. Transparent:=True;
Image1. Stretch:=True;
4, IMage clear picture
Image1. Picture. Assign (nil);
5,
Image4
Image3
Image2
Image1 read in the image, respectively, can only see the image of Image4

6, according to different layer images
(1)
Image4. Picture. Assign (nil); See Image3 image
(2)
Image4. Picture. Assign (nil);
Image3. Picture. Assign (nil); See images of the Image2
(3)
Image4. Picture. Assign (nil);
Image3. Picture. Assign (nil);
Image2. Picture. Assign (nil); See Image1 image
(4)
Image4. Picture. Assign (nil);
Image3. Picture. Assign (nil);
Image2. Picture. Assign (nil);
Image1. Picture. Assign (nil); No image

Said clearly enough, try it yourself,

CodePudding user response:

Pngimage controls

CodePudding user response:

# 1 alchemists,
1. The requirements of the building Lord layer is transparent, not switch layer problem,
2. Switch the layer display can be simple XXX. BringToFront, don't need to release the image,

CodePudding user response:

Image in several layers of transparent background, can only use Png images, controls are to be of support Png, for example: PngImage

Download: http://download.csdn.net/detail/zwd183335/5029010

CodePudding user response:

Standard TImage can also be Transparent background, it is to use color keying technology, also is to specify a color for the key color, every color for key areas in the image are Transparent, precisely TImage. Transparent, TBitmap. Transparent, TBitmap. TransparentColor, TBitmap. TransparentMode these attributes,
  • Related