Hola a todos, tengo esta linea que lee un archivo tiff con 5 imágenes:
@2,2 IMAGE oImageInicia OF oWnd FILE "d:\quiquesoft\SiCredit\Captura2\Imagenes3\111485901.tiff" SCROLL
¿Es posible seleccionar que imágen es la que quierno mostrar?
#include 'fivewin.ch'
#define OFN_PATHMUSTEXIST 0x00000800
#define OFN_NOCHANGEDIR 0x00000008
#define OFN_ALLOWMULTISELECT 0x00000200
#define OFN_EXPLORER 0x00080000 // new look commdlg
#define OFN_LONGNAMES 0x00200000 // force long names for 3.x modules
#define OFN_ENABLESIZING 0x00800000
#define OFN_HIDEREADONLY 0x00000004 // Oculta a caixa de seleção Somente leitura.
#define OFN_NONETWORKBUTTON 0x20000 // Desabilita o botão [ REDE ] da Dlg
function aGetFiles( cMask, cTitle, nDefaultMask, cInitDir )
local cSelect, nAt, aFiles := {}
/*
local nFlags := nOr( OFN_PATHMUSTEXIST , OFN_NOCHANGEDIR , ;
OFN_ALLOWMULTISELECT , OFN_EXPLORER , ;
OFN_LONGNAMES, OFN_ALLOWMULTISELECT )
*/
local nFlags := nOr( OFN_PATHMUSTEXIST, OFN_NOCHANGEDIR, OFN_ALLOWMULTISELECT, ;
OFN_LONGNAMES, OFN_NONETWORKBUTTON )
SKINBUTTONS()
//cSelect := cGetFile( cMask, cTitle, nDefaultMask, cInitDir, .f., .t., nFlags )
cSelect := cGetFile( "Bitmap (*.bmp)| *.bmp|"+ ;
"DIB (*.dib)| *.dib|" + ;
"PCX (*.pcx)| *.pcx|" + ;
"JPEG (*.jpg)| *.jpg|" + ;
"GIF (*.gif)| *.gif|" + ;
"TARGA (*.tga)| *.tga|" + ;
"RLE (*.rle)| *.rle|" + ;
"Todos os Arquivos (*.*)|*.*|" ;
,"Selecione a Foto Desejada",1,,.F.,, nFlags )
cSelect := Left( cSelect, At( Chr( 0 ) + Chr( 0 ), cSelect ) - 1 )
if ! Empty( cSelect )
cSelect := StrTran( cSelect, Chr( 0 ), "," )
aFiles := hb_aTokens( cSelect, "," )
if Len( aFiles ) > 1
for nAt := 2 TO Len( aFiles )
aFiles[ nAt ] := aFiles[ 1 ] + "\" + aFiles[ nAt ]
next nAt
ADel( aFiles, 1 )
ASize( aFiles, Len( aFiles ) - 1 )
endif
endif
return aFiles
DEFINE WINDOW oWnd FROM 0, 0 TO 24, 80
@2,2 IMAGE oImageInicia OF oWnd FILE "111485901.tiff" SCROLL
ACTIVATE WINDOW oWnd MAXIMIZED
quique wrote:
- Code: Select all Expand view
DEFINE WINDOW oWnd FROM 0, 0 TO 24, 80
@2,2 IMAGE oImageInicia OF oWnd FILE "111485901.tiff" SCROLL
ACTIVATE WINDOW oWnd MAXIMIZED
Lo que hace falta es poder decirle que en lugar de mostrar la primera imágen, muestre la segunda
HB_FUNC( GDIPLUSIMGGETFRAME )
{
Bitmap * gifImage = ( Bitmap * ) hb_parnl( 1 );
int index = hb_parni(2) ;
UINT nFrame = gifImage->GetFrameDimensionsCount();
GUID* pDimensionIDs = (GUID*)malloc(sizeof(GUID)*nFrame);
gifImage->GetFrameDimensionsList(pDimensionIDs, nFrame);
gifImage->SelectActiveFrame( &pDimensionIDs[0] , index );
int nWidth = gifImage->GetWidth() ;
int nHeight = gifImage->GetHeight() ;
Bitmap * frameImage = new Bitmap( nWidth, nHeight );
Graphics * gr = new Graphics( frameImage );
gr->DrawImage(gifImage, 0, 0, nWidth, nHeight);
delete gr ;
hb_retnl( ( HB_LONG ) frameImage );
}
local hbitmap
local obmp := tgdiplus():new( "archivo.tif")
local hFrame:= GDIPLUSIMGGETFRAME(obmp:hbmp, 2)
GDIPLUSIMAGEDISPOSE(obmp:hbmp)
hbitmap:= GDIP_GETHBITMAP( hFrame )
.......... usar la imagen ......
GDIPLUSIMAGEDISPOSE( hFrame )
#pragma BEGINDUMP
#include <windows.h>
#include <winuser.h>
#include <wingdi.h>
#include "hbapi.h"
HB_FUNC( GDIPLUSIMGGETFRAME )
{
Bitmap * gifImage = ( Bitmap * ) hb_parnl( 1 );
.
.
.
.
hb_retnl( ( HB_LONG ) frameImage );
}
#pragma ENDDUMP
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: Google [Bot] and 81 guests