Welcome, Guest
Username: Password: Remember me
Components and Libraries for Graphics 3D Development, discussions, problems and suggestions
  • Page:
  • 1

TOPIC:

Printing from glscene 10 years 9 months ago #4151

  • Jacco
  • Jacco's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 8
  • Thank you received: 0
I have a problem printing from GLSceneMemoryViewer (I am using RenderToBitMap).
The printed image gives me a mirrored image of the scene. Does anyone know this problem and have a solution for it?
Attached the printed image (test.jpg) and a screenshot form my application.





This is the code I use:

var
p: TPicture;
bmp: TBitMap;
scale : Single;
begin
p:=TPicture.Create;
bmp:=TBitMap.Create;
try
scale:=1.5;
bmp.PixelFormat:=pf24bit;
bmp.Width:=Round(GLMemoryViewer1.Width*scale);
bmp.Height:=Round(GLMemoryViewer1.Height*scale);
GLMemoryViewer1.Buffer.RenderToBitmap(bmp, Round(96*scale));
p.Bitmap.Width:=bmp.Width;
p.Bitmap.Height:=bmp.Height;
p.Bitmap.PixelFormat:=bmp.PixelFormat;
p.Bitmap.Canvas.Draw(0, 0, bmp);
frmReport.Pictures[0]:=p;
p.SaveToFile('test.jpg');
finally
bmp.Free;
end;
end;

Please Log in or Create an account to join the conversation.

Printing from glscene 10 years 9 months ago #4152

  • kenlee
  • kenlee's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 25
  • Thank you received: 4
A MemViewer still relies on a GLCamera to set up its viewing parameters. Have you checked if you have the right GLCamera assigned to the MemViewer?

Please Log in or Create an account to join the conversation.

Printing from glscene 10 years 9 months ago #4153

  • Jacco
  • Jacco's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 8
  • Thank you received: 0
I used the same GLcamera as the GLViewer uses for the MemViewer. So they should be the same.

Please Log in or Create an account to join the conversation.

Printing from glscene 10 years 9 months ago #4157

  • kenlee
  • kenlee's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 25
  • Thank you received: 4
hm... did you try to test the same outputting routine on a GLScene sample that uses a MemViewer?

Please Log in or Create an account to join the conversation.

Printing from glscene 10 years 9 months ago #4158

  • Jacco
  • Jacco's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 8
  • Thank you received: 0
Not yet. I will give it a try this evening. I will post the results by tomorrow. Thanks for the suggestion.

Please Log in or Create an account to join the conversation.

Printing from glscene 10 years 9 months ago #4165

  • Jacco
  • Jacco's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 8
  • Thank you received: 0
I created a very simple GLScene sample project using a GLViewer and a GLMemViewer. Added a dummycube, with a teapot as childobject, a GLCamera and a GLLightsource. Furthermore I added the printing stuff (same as above) with a TImage in a second form. It produces the same results. See the attached files with a screenshot of the app. and a rendered image which was saved to disk.



Please Log in or Create an account to join the conversation.

Printing from glscene 10 years 9 months ago #4171

  • kenlee
  • kenlee's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 25
  • Thank you received: 4
I tried running a modified sample on both Delphi and CT (attached). The Delphi version was fine making a test output while the CT version gives up-side-down image. So, it looks like it's related to the CT conversion of GLScene. I'm still new to CT and sorry that I can't help further.

File Attachment:

File Name: GLSceneTes...Down.zip
File Size:11 KB

Please Log in or Create an account to join the conversation.

Printing from glscene 10 years 9 months ago #4173

  • Jacco
  • Jacco's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 8
  • Thank you received: 0
Thanks Ideabrush for your help. Is anyone from CT able to help out further? Considering the test Ideabrush made?

Please Log in or Create an account to join the conversation.

  • Page:
  • 1