Показать сообщение отдельно
  #1  
Старый 12.01.2014, 09:14
ProDaNTe ProDaNTe вне форума
Новичок
 
Регистрация: 25.12.2011
Сообщения: 75
Репутация: 10
По умолчанию Круглый прогрессбар

Делаю так
Код:
GDIPAPI, GDIPOBJ

Procedure TForm3.PrepareBMP(bmp: TBitmap; Width, Height: Integer);
var
  p: Pointer;
begin
  bmp.PixelFormat := pf32Bit;
  bmp.Width := Width;
  bmp.Height := Height;
  bmp.HandleType := bmDIB;
  bmp.ignorepalette := true;
  bmp.alphaformat := afPremultiplied;
  // clear all Scanlines
  p := bmp.ScanLine[Height - 1];
  ZeroMemory(p, Width * Height * 4);
end;


procedure TForm3.sButton1Click(Sender: TObject);
const
  Positions  : array [0..6] of Single   = (0.0, 1/6, 2/6, 3/6, 4/6, 5/6, 1);
  CircleSize = 150;
  PenWidth   = 10;
  StartAngle = 120;
  DrawAngle  = 300;
var
  Pen     : TGPPen;
  Graphics: TGPGraphics;
  Colors     : Cardinal;
  bmp: TBitmap;
  G: TGPGRaphics;
  B: TGPSolidBrush;
  i:Integer;
begin
bmp := TBitmap.Create;
  PrepareBMP(bmp, 300, 300);

  Graphics := TGPGRaphics.Create(bmp.Canvas.Handle);
  Graphics.SetSmoothingMode(SmoothingModeAntiAlias8x8);
  Pen:=TGPPen.Create(aclAqua, PenWidth);
  PatBlt(Image1.Canvas.Handle, 0, 0, Image1.ClientWidth, Image1.ClientHeight, ALPHA_SHIFT);
 for i := 1 to 360 do
   begin

  Graphics.DrawArc(Pen, MakeRect(PenWidth div 2, PenWidth div 2, CircleSize-PenWidth, CircleSize-PenWidth), -90+i, 7/5);
  PatBlt(Image1.Canvas.Handle, 0, 0, Image1.ClientWidth, Image1.ClientHeight, ALPHA_SHIFT);
  Image1.Canvas.Draw(0, 0, bmp);
  sleep(10);
  Application.ProcessMessages;

   end;
bmp.Free;
Graphics.Free;
end;

Но прозрачность корявая, то есть в сглаженных местах черный ореол!
Ответить с цитированием