Ver Mensaje Individual
  #1  
Antiguo 16-07-2015
shoulder shoulder is offline
Miembro
 
Registrado: abr 2008
Posts: 441
Reputación: 17
shoulder Va por buen camino
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.
Responder Con Cita