Changeset 279 for branches/AlphaChannel/Packages
- Timestamp:
- Sep 6, 2020, 12:29:02 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/AlphaChannel/Packages/CevoComponents/ScreenTools.pas
r278 r279 448 448 if Result then 449 449 begin 450 Bmp.Assign(Png); 451 //Bmp.SetSize(Png.Width, Png.Height); 452 //Bmp.PixelFormat := Png.PixelFormat; 453 //Bmp.Canvas.FillRect(0, 0, Bmp.Width, Bmp.Height); 454 //FillRectBitmap(Bmp, $00000000); 450 Bmp.Assign(Png); // Force Bmp image description from Png to have alpha channel 451 455 452 if (Png.RawImage.Description.Format = ricfGray) then 456 453 begin … … 459 456 CopyGray8BitTo24bitBitmap(Bmp, Png); 460 457 end; 461 //else462 //Bmp.Canvas.Draw(0, 0, Png);463 //Bmp.SaveToFile(Path + '.bmp');464 458 end; 465 459 Png.Free; … … 513 507 GrExt[nGrExt].Name := Name; 514 508 515 //xmax := Source.Width - 1; // allows 4-byte access even for last pixel 509 // TODO: allows 4-byte pixel access even for last pixel to avoid memory overflow 510 xmax := Source.Width - 1; 516 511 // Why there was that limit? 517 512 //if xmax > 970 then … … 533 528 MaskPixel := PixelPointer(GrExt[nGrExt].Mask); 534 529 for y := 0 to ScaleToNative(Source.Height) - 1 do begin 535 for x := 0 to ScaleToNative( Source.Width) - 1 do begin530 for x := 0 to ScaleToNative(xmax) - 1 do begin 536 531 if SourcePixel.Pixel^.ARGB = $00000000 then begin // transparent 537 532 MaskPixel.Pixel^.ARGB := $FFFFFF;
Note:
See TracChangeset
for help on using the changeset viewer.