ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Layer Rotation and "export" as image

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
markus42 Posted - Jan 07 2013 : 07:43:52
Hello,

i am using TimageENView with some layers (i need layers because some pictures have to displayed about each other during imageprocessing).
The layers can rotated by mouse. After finished all steps in my application i have to "export" the images in the layers to single files (as jpeg) and it's important to export the rotation too.

I hope somebody can helping me.

Kind Regards

Markus42
8   L A T E S T    R E P L I E S    (Newest First)
markus42 Posted - Jan 08 2013 : 11:00:34
For all who has the same problem.

William Miller sends me a code with that solution, this works fine for me.
Thanks Bill.


var
  i: integer;
  iImageEnIO: TImageEnIO;
  iFolder: string;
  iFilename: string;
begin
  Screen.Cursor := crHourGlass;
  try
    iFolder := 'c:\temp\';
    iImageEnIO := TImageEnIO.Create(nil);
    try
      for i := 0 to ImageEnView1.LayersCount - 1 do
      begin
        ImageEnView1.LayersFixRotations(i);
        ImageEnView1.LayersFixSizes(i);
        ImageEnView1.LayersFixBorders(i);
        iImageEnIO.AttachedIEBitmap := ImageEnView1.Layers[i].Bitmap;
        iFilename := iFolder + 'Export' + IntToStr(i) + '.jpg';
        iImageEnIO.SaveToFileJpeg(iFilename);
      end;
    finally
      iImageEnIO.Free;
    end;
  finally
    Screen.Cursor := crDefault;
  end;
w2m Posted - Jan 08 2013 : 08:47:33
Send your email to w2m@frontiernet.net.

William Miller
markus42 Posted - Jan 08 2013 : 08:39:28
It will be great if you can send me your demo. By the way, i am using Rad-Studio 2010 but i don't think this is the problem.

Kind Regards
w2m Posted - Jan 08 2013 : 08:20:08
I am using 4.1.4 as well. I just tested it again. I added 3 layers and rotated layer 1 and 2 and exported. All of the images were rotated correctly. I'll see if I can send you my demo and you can try that.

What layers did you rotate?

William Miller
markus42 Posted - Jan 08 2013 : 07:29:14
I am very sorry, but i try it now in the layers demo with the same result. Rotation not "exported". I rotate 90° and some other values.
IMAGEn version is 4.1.4.

Kind Regards

Markus
w2m Posted - Jan 08 2013 : 05:53:13
The code saves the images with rotation here. How many degrees did you rotate? I rotated 90 degrees. I did not test other degrees.

William Miller
markus42 Posted - Jan 08 2013 : 02:44:25
Hello Mr. Miller,

thank you alot for your answer. But i am have a problem with this.
The "export" creates an jpeg-file, but without the rotation.
Perhaps i have to set an "special setting"?

I'm hoping you can spent some time to helping me.

Kind regards

Markus
w2m Posted - Jan 07 2013 : 12:04:24
The following code was added to the layers example. I tested it and the rotated layers are saved correctly:

Update

procedure Tfmain.Export1Click(Sender: TObject);
var
  i: integer;
  iImageEnIO: TImageEnIO;
  iFolder: string;
  iFilename: string;
begin
  Screen.Cursor := crHourGlass;
  try
    iFolder := 'c:\temp\';
    iImageEnIO := TImageEnIO.Create(nil);
    try
      for i := 0 to ImageEnView1.LayersCount - 1 do
      begin
        // Update
        ImageEnView1.LayersFixRotations(i);
        ImageEnView1.LayersFixSizes(i);
        ImageEnView1.LayersFixBorders(i);
        iImageEnIO.AttachedIEBitmap := ImageEnView1.Layers[i].Bitmap;
        iFilename := iFolder + 'Export' + IntToStr(i) + '.jpg';
        iImageEnIO.SaveToFileJpeg(iFilename);
      end;
    finally
      iImageEnIO.Free;
    end;
  finally
    Screen.Cursor := crDefault;
  end;
end;

William Miller
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html