Search the Community
Showing results for tags 'png'.
Found 4 results
-
Hi everyone, In my project, I’m trying to update all the places where we display images using the TImage component to use the WICImage property instead, in order to improve display performance. However, I’m facing the following issue: I want to display a PNG image without its background using WICImage, but from what I’ve found, it seems I can’t interact with the alpha channel to achieve this. Does anyone have any recommendations? Delphi 12
-
Hi. I'm trying change icons of my Android app, and i made all as earlier - on the way Project>Option>Application>Icons. I changed all Embarcadero's default icons to my icons. But when i compile my app, i see all the same app icons in my phone. What's wrong i made?
-
Calculation of the illumination of a point for PNG image, taking into account transparency
lisichkin_alexander posted a topic in Algorithms, Data Structures and Class Design
Hello! It is required to calculate the illumination of a point in a TPNGImage object, taking into account transparency. I wrote the following algorithm: function GetBrightness(const AImage: TPNGImage; AX, AY: Integer): Integer; var LColor, LTransparentColor: TColor; r, g, b, alpha: Byte; tr, tg, tb: Byte; LDstAlpha: pByteArray; begin LColor := AImage.Pixels[AX, AY]; r := Byte(LColor); g := Byte(LColor shr 8); b := Byte(LColor shr 16); if AImage.Transparent and (LColor <> 0) then begin if (AImage.Header.ColorType in [COLOR_RGBALPHA, COLOR_GRAYSCALEALPHA]) then begin LDstAlpha := AImage.AlphaScanline[AY]; if Assigned(LDstAlpha) then begin alpha := LDstAlpha[AX]; r := Byte(Round(r * alpha/255)); g := Byte(Round(g * alpha/255)); b := Byte(Round(b * alpha/255)); end; end else if AImage.Header.ColorType = COLOR_PALETTE then begin LTransparentColor := AImage.TransparentColor; tr := Byte(LTransparentColor); tg := Byte(LTransparentColor shr 8); tb := Byte(LTransparentColor shr 16); r := Byte(Round(r * tr/255)); g := Byte(Round(g * tg/255)); b := Byte(Round(b * tb/255)); end; end; Result := Round(0.3*r + 0.59*g + 0.11*b); end; Please analyze my algorithm for errors. P.S. Unfortunately, in my test base there are no images with TransparentColor - only with alpha channel. Alexander. -
Datamodule with ImageCollection of PNGs loading with packages
Mike Scott posted a topic in General Help
I have a datamodule with imagecollections holding .PNG files. If I compile a Debug build (no packages) all is well. However, a Release build with various packages including vcl;vclx;rtl;vclimg;vclSmp;vclwinX;bindengine; reliably gives trouble. I CoInitialize before and CoUninitialize after the load. The loading mechanism which gives an AV in vcl280.bpl. Image 1 shows what Eurekalog diagnoses. The images are all PNG files. Image 2 shows the source. I get an AV when creating the DatamoduleAlImages or when I get to Application.Run.- 2 replies
-
- datamodule
- imagecollection
-
(and 3 more)
Tagged with:
![Delphi-PRAXiS [en]](https://en.delphipraxis.net/uploads/monthly_2018_12/logo.png.be76d93fcd709295cb24de51900e5888.png)