Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2006.07.09;
Скачать: CL | DM;

Вниз

Проблема с TBitmap.StretchDraw   Найти похожие ветки 

 
Muxaspb ©   (2005-10-21 17:22) [0]

Проблема такая:
процедуры
Canvas.StretchDraw(Rect, Bitmap) в VCL и
Bitmap.StretchDraw(DC, Rect) в KOL работают по-разному.
Если нужно уменьшить изображение, то в KOL результат гораздо хуже.
Как это можно исправить?


 
thaddy   (2005-10-21 19:00) [1]

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?


 
Vladimir Kladov   (2005-10-21 20:04) [2]

SetStretchBltMode( Bitmap.Canvas.Handle, halftone );


 
Muxaspb ©   (2005-10-22 00:11) [3]

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-22 08:08) [4]

надо наоборот
SetStretchBltMode( TargetCanvas.Handle {у вас = DC}, halftone )


 
thaddy   (2005-10-22 11:52) [5]

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;


 
Muxaspb ©   (2005-10-22 14:11) [6]

thaddy and Vladimir, thanks a lot. It"s all working.



Страницы: 1 вся ветка

Текущий архив: 2006.07.09;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.039 c
2-1150212253
Mr tray
2006-06-13 19:24
2006.07.09
#13#10


1-1148624968
AntonGF
2006-05-26 10:29
2006.07.09
Связь переменной со свойством компанента и наоборот


2-1151053682
elfebet
2006-06-23 13:08
2006.07.09
Не пойму ошибку и как выйти из ситуации.


4-1143023514
Alex Kryuchkov
2006-03-22 13:31
2006.07.09
Серийный номер мат. платы


3-1147263291
SHD
2006-05-10 16:14
2006.07.09
И снова значения по умолчанию.