1
0
mirror of https://github.com/moparisthebest/Simba synced 2025-01-10 21:28:00 -05:00

Seriously learn the difference between (xe-xs) and Width. KTHNX! Since (xe-xs) <> Width.

git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@139 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
Raymond 2009-10-18 13:56:12 +00:00
parent 0109f1c91c
commit 25d196ee75
3 changed files with 377 additions and 384 deletions

View File

@ -38,7 +38,7 @@ begin;
with CurrThread.Client.MWindow do
begin;
GetDimensions(w,h);
with CopyClientToBitmap(0,0,w,h) do
with CopyClientToBitmap(0,0,w-1,h-1) do
begin;
SaveToFile(FileName);
Free;

View File

@ -80,19 +80,11 @@ threadvar
{Some General PS Functions here}
procedure psWriteln(str : string);
{$IFDEF WINDOWS}
var
CriticalSec : TRTLCriticalSection;
begin
System.InitCriticalSection(CriticalSec);
System.EnterCriticalSection(CriticalSec);
try
if CurrThread.DebugTo <> nil then
begin;
CurrThread.DebugTo.lines.add(str);
CurrThread.DebugTo.Refresh;
end;
finally
System.LeaveCriticalSection(CriticalSec);
if CurrThread.DebugTo <> nil then
begin;
CurrThread.DebugTo.lines.add(str);
CurrThread.DebugTo.Refresh;
end;
end;
{$ELSE}

View File

@ -407,9 +407,10 @@ var
begin
Self.GetDimensions(w, h);
//THIS IS NOT THE FUCKING WIDTH/HEIGHT YA!
ww := xe-xs;
hh := ye-ys;
if(xs < 0) or (ys < 0) or (xe > W) or (ye > H) then
if(xs < 0) or (ys < 0) or (xe >= W) or (ye >= H) then
Raise Exception.CreateFMT('CopyClientToBitmap TMWindow: Faulty coordinates (%d,%d)(%d,%d); Width/Height is (%d,%d)',[xs,ys,xe,ye,w,h]);
if Self.Frozen then
begin;
@ -426,8 +427,8 @@ begin
begin
{$IFDEF MSWINDOWS}
Result := TBitmap.Create;
Result.SetSize(ww,hh);
BitBlt(result.canvas.handle,0,0,ww,hh,
Result.SetSize(ww+1,hh+1);
BitBlt(result.canvas.handle,0,0,ww+1,hh+1,
self.TargetDC,xs,ys, SRCCOPY);
{$ENDIF}
end;
@ -436,7 +437,7 @@ begin
{$IFDEF LINUX}
Old_Handler := XSetErrorHandler(@MufasaXErrorHandler);
Img := XGetImage(Self.XDisplay, Self.curWindow, xs, ys, ww, hh, AllPlanes, ZPixmap);
Img := XGetImage(Self.XDisplay, Self.curWindow, xs, ys, ww+1, hh+1, AllPlanes, ZPixmap);
XImageToRawImage(Img, Raw);
Bmp := TBitmap.Create;