Changeset 279


Ignore:
Timestamp:
Sep 6, 2020, 12:29:02 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Big textures upscaled from middle ones instead of smaller ones.
Location:
branches/AlphaChannel
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/AlphaChannel/Packages/CevoComponents/ScreenTools.pas

    r278 r279  
    448448    if Result then
    449449    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
    455452      if (Png.RawImage.Description.Format = ricfGray) then
    456453      begin
     
    459456        CopyGray8BitTo24bitBitmap(Bmp, Png);
    460457      end;
    461       //else
    462         //Bmp.Canvas.Draw(0, 0, Png);
    463       //Bmp.SaveToFile(Path + '.bmp');
    464458    end;
    465459    Png.Free;
     
    513507    GrExt[nGrExt].Name := Name;
    514508
    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;
    516511    // Why there was that limit?
    517512    //if xmax > 970 then
     
    533528    MaskPixel := PixelPointer(GrExt[nGrExt].Mask);
    534529    for y := 0 to ScaleToNative(Source.Height) - 1 do begin
    535       for x := 0 to ScaleToNative(Source.Width) - 1 do begin
     530      for x := 0 to ScaleToNative(xmax) - 1 do begin
    536531        if SourcePixel.Pixel^.ARGB = $00000000 then begin // transparent
    537532          MaskPixel.Pixel^.ARGB := $FFFFFF;
Note: See TracChangeset for help on using the changeset viewer.