Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Varios (https://www.clubdelphi.com/foros/forumdisplay.php?f=11)
-   -   Rotacion con Twain en Delphi (https://www.clubdelphi.com/foros/showthread.php?t=88695)

shoulder 16-07-2015 20:34:00

Rotacion con Twain en Delphi
 
Hola cuando escaneo una imagen con delphi no me aparece en el menu la opcion de rotacion solamente de color de imagen o brillo estoy usando los siguientes comandos.

Código Delphi [-]

    Twain.LoadLibrary;
    Twain.LoadSourceManager;
    Twain.Source[CurrentSource].Loaded := TRUE;
    Twain.Source[CurrentSource].SetIPixelType(tbdGray);
    Twain.Source[CurrentSource].TransferMode := Self.TransferMode;
    Twain.Source[CurrentSource].SetIXResolution(200-00);
    Twain.Source[CurrentSource].SetIYResolution(200-00);
    ClearImageList; {Clear list of images}
    Twain.Source[CurrentSource].EnableSource(ItemShowInterface.Checked, FALSE);
    Twain.Source[CurrentSource].TransferMode := Self.TransferMode;
    Twain.Source[CurrentSource].EnableSource(False, False);
    while Twain.Source[CurrentSource].Enabled do
       Application.ProcessMessages;


Lo que estoy haciendo es llevar la imagen a un Bitmap pero solamente me hace la Opcion Vertical u Horizontal pero nada de rotacion de 90 grados a derecha o izquierda

Código Delphi [-]
procedure TFormMainP.ItemFlipVerticalClick(Sender: TObject);
var
  Image: TBitmap;
begin
  if GetCurrent(Image) then {In case there is an image}
  begin
    Image.Canvas.StretchDraw(Rect(0, Image.Height, Image.Width, 0), Image);
    Self.Image.Picture.Assign(TBitmap(ImageList[CurrentImage]));
  end {if GetCurrent}
end;

{Flip the current image horizontally}
procedure TFormMainP.ItemFlipHorizontalClick(Sender: TObject);
var
  Image: TBitmap;
begin
  if GetCurrent(Image) then {In case there is an image}
  begin
    Image.Canvas.StretchDraw(Rect(Image.Width, 0, 0, Image.Height), Image);
    Self.Image.Picture.Assign(TBitmap(ImageList[CurrentImage]));
  end {if GetCurrent}
end;




Puedo dentro de delphi como opcion hacer rotacion de imagen o puedo agregar mediante un comando la opcion en el Twain al momento del escaneo?.

Gracias.

Ñuño Martínez 17-07-2015 14:42:32

Hay bibliotecas, como la Vampyre, que permite modificar imágenes casi de cualquier forma imaginable. Aunque como lo que quieres es sencillo, quizá es que hagas tú mismo el giro.


La franja horaria es GMT +2. Ahora son las 05:33:59.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi