Hello,
I am finishing the conversion of a win32 app to gtk. Everything goes
fine, except that I need to substitute win api calls to StretchBlt with
something else.
So I thought about using LCLIntf.StretchBlt. I used it just like I was
using on Windows:
LCLIntf.StretchBlt(DestCanvas.Handle, GlassLeft + 4, GlassTop + 4,
GlassWidth - 8, GlassHeight - 8,
bmpDisplay.Canvas.Handle, ScreenRect.Left, ScreenRect.Top,
ScreenRect.Right - ScreenRect.Left, ScreenRect.Bottom -
ScreenRect.Top, SRCCOPY);
Works well on Windows, but on Linux I get many gtk error messages, like
this:
[CRITICAL] file gdk-pixbuf-drawable.c: line 1109 (gdk_pixbuf_get_from_drawable):
assertion `dest_x == 0 && dest_y == 0' failed.
WARNING: ScalePixmap ScaleSRC=nil
WARNING: ScaleAndROP ScalePixmap for pixmap failed
WARNING: SrcDevBitmapToDrawable: ScaleAndROP failed
So I tryed to investigate what happens with LCLIntf.StretchBlt. I say
the implementation on gtk, didn't understang much about it, but I found
many places checking the -dVerboseStretchCopyArea define for debugging.
Then I tryed to compile Lazarus with -dVerboseStretchCopyArea, figuring
this could give me a clue about what is going on. It won't compile
(latest subversion). I got lot's of errors complaining about argument
number, received Integer, but expected ansistring and received boolean
but expected ansistring on DebugLn.
I surounded all Integer with IntToStr(), commented out the Booleans (
How do I transform a boolean to string easely???) and got it to compile.
Now, I can make a patch with this, but I am not sure if the DebugLn
function shouldn't be corrected to accept integers and booleans instead
of trying to use hundreds of IntToStr() ...
Here is a sample of one of the debug lines got after I edited it:
{$IFDEF VerboseStretchCopyArea}
DebugLn('StretchCopyArea Cliping Src to left NewSrcWidth=',
IntToStr(NewSrcWidth),' NewWidth=',IntToStr(NewWidth));
{$ENDIF}
Now, going back to my application, I got the LCL to compile with
VerboseStretchCopyArea, but now there are lot's of messages, lot's
really lot's and I don't know what should be right and wrong ....
The best thing I can think of is: My pictures are bitmap, but I should
be working with Pixmaps on GTK. Is this correct???
Felipe
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives