- Posts: 8
- Thank you received: 0
- Forum
- CodeTyphon Studio
- CodeTyphon Studio Components and Libraries
- Graphics 3D Development
- Printing from glscene
×
Components and Libraries for Graphics 3D Development, discussions, problems and suggestions
Question Printing from glscene
- Jacco
-
Topic Author
- Offline
- New Member
-
Less
More
7 years 8 months ago #4151
by Jacco
Printing from glscene was created by Jacco
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;
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.
- kenlee
-
- Offline
- Junior Member
-
Less
More
- Posts: 25
- Thank you received: 4
7 years 8 months ago #4152
by kenlee
Replied by kenlee on topic Printing from glscene
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.
- Jacco
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 8
- Thank you received: 0
7 years 8 months ago #4153
by Jacco
Replied by Jacco on topic Printing from glscene
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.
- kenlee
-
- Offline
- Junior Member
-
Less
More
- Posts: 25
- Thank you received: 4
7 years 8 months ago #4157
by kenlee
Replied by kenlee on topic Printing from glscene
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.
- Jacco
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 8
- Thank you received: 0
7 years 8 months ago #4158
by Jacco
Replied by Jacco on topic Printing from glscene
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.
- Jacco
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 8
- Thank you received: 0
7 years 8 months ago #4165
by Jacco
Replied by Jacco on topic Printing from glscene
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.
- kenlee
-
- Offline
- Junior Member
-
Less
More
- Posts: 25
- Thank you received: 4
7 years 7 months ago #4171
by kenlee
Replied by kenlee on topic Printing from glscene
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.
Please Log in or Create an account to join the conversation.
- Jacco
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 8
- Thank you received: 0
7 years 7 months ago #4173
by Jacco
Replied by Jacco on topic Printing from glscene
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.