![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Проблема с TBitmap.StretchDraw
Muxaspb © (2005-10-21 17:22:00)Проблема такая:
процедуры
Canvas.StretchDraw(Rect, Bitmap) в VCL и
Bitmap.StretchDraw(DC, Rect) в KOL работают по-разному.
Если нужно уменьшить изображение, то в KOL результат гораздо хуже.
Как это можно исправить?
Muxaspb (2005-10-22 14:11:00) [1]thaddy and Vladimir, thanks a lot. It's all working.
thaddy (2005-10-22 11:52:00) [2]Vladimir is right ;)
I have tested it. This works exactly the same:
procedure TForm1.dopaint(sender: Pcontrol; dc: hdc);
begin
SetStretchBltMode(dc, halftone);
jpg.Draw(dc,0,0);
jpg.StretchDraw(dc,Makerect(200,200,300,300));
end;
Vladimir Kladov (2005-10-22 08:08:00) [3]надо наоборот
SetStretchBltMode( TargetCanvas.Handle {у вас = DC}, halftone )
Muxaspb (2005-10-22 00:11:00) [4]2 thaddy
First I tried to do this:
procedure TForm1.PaintBox1Paint(Sender: PControl; DC: HDC);
begin
Bitmap.StretchDraw(DC, PaintBox1.ClientRect);
end;
Then I tried todo this:
procedure TForm1.PaintBox1Paint(Sender: PControl; DC: HDC);
var
TempBMP: PBitmap;
begin
TempBMP:=NewDibBitmap(Bitmap.Width,Bitmap.Height, Bitmap.PixelFormat);
TempBMP.Assign(Bitmap);
TempBMP.StretchDraw(DC, PaintBox1.ClientRect);
TempBMP.Free;
end;
But result is the same.
You can see what I have: http://www.sghsrv.nm.ru/StretchDraw.jpg
2 Vladimir Kladov
То, что Вы написали, ничего не меняет.
Vladimir Kladov (2005-10-21 20:04:00) [5]SetStretchBltMode( Bitmap.Canvas.Handle, halftone );
thaddy (2005-10-21 19:00:00) [6]The results should be the same. In any case, make shure it's a DIB bitmap, then KOL is even better or the same. Can you send me an example?