Recent

Author Topic: Access violation with TPicture  (Read 5478 times)

Zeugma

  • New Member
  • *
  • Posts: 10
Access violation with TPicture
« on: November 23, 2004, 11:25:10 pm »
I've tried to execute the following code which is working in Delphi. img is a TImage that is on my main form. The code below is run when I hit a button.

Code: [Select]
 
  img.canvas.pen.color := clRed;
  img.canvas.pen.style := psDashDot;
  img.canvas.moveto(10,10);
  img.canvas.lineto(80,10);

  img.Canvas.TextOut(10,10,'theTest');

  // CRASHES WHEN RUNNING NEXT LINE
  img.picture.bitmap.SaveToFile('C:\temp\screenshot.bmp');


The SaveToFile method generates an access violation. The file screenshot.bmp is created in the temp folder but it remains empty (O bytes). However, when trying this method on a TImage whose bitmap has been loaded at design-time, it works perfectly.

I've tried it with your latest binary (10th October installer) as well as with today's snapshot (23rd November). Is that possible to fix this error manually ? Is there any trick to get this to work ?

Thanks in advance,

-Zeugma

Zeugma

  • New Member
  • *
  • Posts: 10
Access violation with TPicture
« Reply #1 on: December 14, 2004, 06:38:34 pm »
Now with the latest binary (and the same code), I get the message "Project raised exception class 'External: SIGSEGV'.

Any idea of what's going on with the saving of TBitmaps ?

Anonymous

  • Guest
Access violation with TPicture
« Reply #2 on: December 14, 2004, 09:09:34 pm »
Disable the debugger, i have problems with it (maybe only smart linking needs to be disabled and stripping).
Color setting was buggy before, it should work with the latest binary(0.9.2.4)

Anonymous

  • Guest
Access violation with TPicture
« Reply #3 on: December 19, 2004, 05:34:36 pm »
Disabling the debugger only makes the application generate a good old access violation :D This usage of TPicture doesn't work yet on 0.9.2.4  :roll:

Any ideas, anyone ?

Zeugma

  • New Member
  • *
  • Posts: 10
Access violation with TPicture
« Reply #4 on: December 19, 2004, 06:22:56 pm »
I've just realized that my last post has been made with the Guest account  :?
Just consider it was me  8)

Lightning

  • Sr. Member
  • ****
  • Posts: 422
Access violation with TPicture
« Reply #5 on: December 21, 2004, 11:22:03 am »
Hmm, i will try, it should work.
The future must be... Fast and OpenSource so...
Think Open and Lightning Fast!