Advertisement
Guest User

Untitled

a guest
Dec 10th, 2017
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.62 KB | None | 0 0
  1. var
  2.   Bmp: TBitmap;
  3.   x1, y1: Integer;
  4.   px: PRGBQuad;
  5. begin
  6.   Bmp := TBitmap.Create;
  7.   try    
  8.     Bmp.Width := Image1.Width;
  9.     Bmp.Height := Image1.Height;
  10.     Bmp.PixelFormat := pf32bit;
  11.     Bmp.HandleType := bmDIB;
  12.     Bmp.IgnorePalette := True;
  13.    
  14.     for y1 := 0 to Bmp.Height - 1 do
  15.     begin
  16.       px := Bmp.ScanLine[y1];
  17.       for x1 := 0 to Bmp.Width - 1 do
  18.       begin
  19.         px.rgbBlue := 0;
  20.         px.rgbGreen := 0;
  21.         px.rgbRed := 0;
  22.         px.rgbReserved := 0;  // fully transparent
  23.         Inc(px);
  24.       end;
  25.     end;
  26.    
  27.     //...
  28.  
  29.   finally      
  30.     Bmp.Free;
  31.   end;
  32. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement