Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2000-11

Put Pixel

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Luis R. Hilario B.
to Shane Miller: Try Canvas.Pixels[500,475] := clRed; Shane It worked well, but Canvas.Line(To) he is…
Shane Miller wrote 6 lines
Try Canvas.Pixels[500,475] := clRed; Shane

It does not work. :(
FPC 1.0.x Windows

with Form1 do
begin
 Canvas.pen.style := psSolid;
 Canvas.pen.color := $FF0000; //clRed;
 Canvas.Line(0,0,150,150);
 Canvas.Pixels[151,151] := clRed; // Error
 end;

LM_SCREENINIT called --> should go to GTKObject.Init TODO: check this

Gtk-CRITICAL **: file gtkobject.c: line 1080 (gtk_object_get_data): assertion `GTK_IS_OBJECT (object)' failed.

Gdk-CRITICAL **: file gdkimage-win32.c: line 326 (gdk_image_get): assertion `window != NULL' failed.

Gdk-CRITICAL **: file gdkimage-win32.c: line 594 (gdk_image_put_pixel): assertion `image != NULL' failed.

Gtk-CRITICAL **: file gtkobject.c: line 1034 (gtk_object_set_data): assertion `GTK_IS_OBJECT (object)' failed.

Gtk-CRITICAL **: file gtkobject.c: line 1080 (gtk_object_get_data): assertion `GTK_IS_OBJECT (object)' failed.
An unhandled exception occurred at 0x00409E7F :
Access violation
0x00409E7F
0x0274FA0C

[TgtkObject.Destroy] WARNING: There are 12 unreleased DCs and 44 unreleased GDIObjects
[TgtkObject.Destroy] WARNING: There are 1 messages left in the queue! I'll free them

|--------------------------| | Luis R. Hilario | | http://luisdigital.2y.net | |--------------------------|
Shane Miller
Try
Canvas.Pixels[500,475] := clRed;

Shane

>> 11/01/00 10:27AM >>>
Shane Miller wrote 11 lines
with Form1 do begin Canvas.Pen.Style := psSolid; Canvas.Pen.Color := clRed; Canvas.Line(400,500,450,550); end; Shane

It worked well, but Canvas.Line(To) he is slower than to put only a pixel.
I want something like PutPixel() in Pascal.

Thanks!

|--------------------------| | Luis R. Hilario | | http://luisdigital.2y.net | |--------------------------| _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus
Shane Miller

Hmmm... I guess that explains that.

IF you look at the canvas code in the lazarus/lcl/include directory in canvas.inc you'll see there's a SetPixel function that uses CNSendMessage to send a command to the gtkint.pp "module". IF you go into gtkobject.inc and trace the message sent by the CNSendMessage you can see what, if anything, it is doing.

I'm not sure how easy it is to implement (I haven't looked at it) but I don't imagine it would be too tough.

Is this something you would like to try and look at Luis? It could be a good intro to Lazarus programming.... ????

Shane

>> 11/01/00 04:53PM >>>
Shane wrote 5 lines
Try Canvas.Pixels[500,475] := clRed; Shane

This is not implemented (yet)

Marc

_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus