Dear Mr. Uwe,
Can you make a BLOB version sample?
Kind Regards,
Frances
Frances
Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
Dear Mr. Uwe,
Can you make a BLOB version sample?
Kind Regards,
Frances
fraxzi wrote:Dear Mr. Uwe,
Can you make a BLOB version sample?
Kind Regards,
Frances
nageswaragunupudi wrote:fraxzi wrote:Dear Mr. Uwe,
Can you make a BLOB version sample?
Kind Regards,
Frances
Are you reading from ADS or MySql?
If you are reading image buffer from some datasource, please assign oCol:bEditvalue := { || <expression_returning_imagebuffer> } and set oCol:cDataType := 'P'
Try this with a normal browse first. Then we can program any variations like this.
Mr. Frances
To store image buffer, we need not use blob functions.
Using ADSCDX:
<anymemofield> := <cImageBuffer> // Eg. MemoRead( "zzz.jpeg" )
and
<cImageBuffer> := <fieldname>
Using ADSADT:
We can define a field with type "Image". Syntax is same as above.
To browse image fields with XBrowse, you NEED NOT do anything. Simpy browse the table as if it is a normal field. I recommend you assign adequate oBrw:nRowHeight and oCol:nWidth if you like a particular size for the column.
XBrowse automatically detects that the data is Image and displays the image snugly resizing the image to fit the cell dimensions.
Try browsing
wwonders.dbf
flds.adt
in the samples folder.
You need not even tell the xbrowse that the data is binary data containing an image buffer.


...
...
@ 10, 300 SELEX nOption1 SIZE 145, 35 PIXEL;
ITEMS "1&00", "1&20", "&1&40", "1&60", "1&80", "2&00", "&Full";
GRADIENT OUTTRACK { { 0.5, 16770250, 16312263 }, ;
{ 0.5, 16312263, 16770250 } } ;
GRADIENT INTRACK { { 0.5, 8388608, 16312263 }, ;
{ 0.5, 16312263, 8388608 } } ;
THUMBSIZE 40, 25 ROUNDSIZE 10 ;
COLOR THUMB 14853684 ;
COLORTEXT 128, 32768 ;
TITLE "Cell-Size" TOP ;
FONT oFont1 ;
ACTION( IIF( nOption1 = 1, nCellSize := 100, NIL ), ;
IIF( nOption1 = 2, nCellSize := 120, NIL ), ;
IIF( nOption1 = 3, nCellSize := 140, NIL ), ;
IIF( nOption1 = 4, nCellSize := 150, NIL ), ;
IIF( nOption1 = 5, nCellSize := 160, NIL ), ;
IIF( nOption1 = 6, nCellSize := 200, NIL ), ;
IIF( nOption1 = 7, nCellSize := 400, NIL ), ;
CELL_ADJUST( oBrw2, nOption1 ) ) ;
COLORTITLE 0
...
...
// ------------------------
FUNCTION CELL_ADJUST( oBrw2, nOption1 )
LOCAL oCol
FOR nCol := 1 to Len( oBrw2:aCols )
WITH OBJECT oBrw2:aCols[ nCol ]
:nWidth := nCellSize
:bPaintText := { | oCol, hDC, cData, aRect, aColors, lHighLite | ;
DrawCell( oCol, hDC, cData, aRect, aColors, lHighLite ) }
END
NEXT
oBrw2:nRowHeight := nCellSize + 20
oBrw2:Refresh()
RETURN( NIL )



Is it possible to define a fixed Position ?
@ 30, 15 BTNBMP oBtn0 OF oDlg1 ;
SIZE 100, 40 ;
PROMPT " &Select " + CRLF + " Directory" FILE c_path + "\Bitmaps\Preview.bmp" 2007 ;
FONT oTxtfont LEFT ;
ACTION ( cSUBDIR := cGetDir( "Select a directory",;
CurDrive() + ":\" + GetCurDir() ) + "\", ;
oSUBDIR:Refresh() , ;
aImg := ReadImages( cSUBDIR ), oBrw2:End(), SHOW_BROW(oDlg1) )



...
@ 75, 120 SELEX oSelex5 VAR nOption5 SIZE 175, 30 PIXEL;
ITEMS "&100%", "&150%", "&200%", "&400%", "&500%", "&Copy", "&Disabl." ;
GRADIENT OUTTRACK { { 0.5, 16770250, 16312263 }, ;
{ 0.5, 16312263, 16770250 } } ;
GRADIENT INTRACK { { 0.5, 8388608, 16312263 }, ;
{ 0.5, 16312263, 8388608 } } ;
THUMBSIZE 40, 25 ROUNDSIZE 10 ;
COLOR THUMB 14853684 ;
COLORTEXT 128, 32768 ;
TITLE "Image-Action on left Click" TOP ;
FONT oTxtfont ;
ACTION ( IIF( nOption5 = 6, MsgAlert( "Image-copy selected","Attention " ), NIL ), ;
IIF( nOption5 = 7, MsgAlert( "Cell-function disabled","Attention " ), NIL ) ) ;
COLORTITLE 0
...
...
FUNCTION IMG_ZOOM()
LOCAL oDlg, oImage, oBrush, nWidth, nHeight, cFactor
DEFINE IMAGE oImage FILE cImgname
// DEFINE BRUSH oBrush FILE c_path + "\Bitmaps\STONE.BMP"
IF nOption5 = 1
nWidth := oImage:nWidth()
nHeight := oImage:nHeight()
cFactor := "100 %"
ENDIF
IF nOption5 = 2
nWidth := oImage:nWidth() * 1.5
nHeight := oImage:nHeight() * 1.5
cFactor := "150 %"
ENDIF
IF nOption5 = 3
nWidth := oImage:nWidth() * 2
nHeight := oImage:nHeight() * 2
cFactor := "200 %"
ENDIF
IF nOption5 = 4
nWidth := oImage:nWidth() * 4
nHeight := oImage:nHeight() * 4
cFactor := "400 %"
ENDIF
IF nOption5 = 5
nWidth := oImage:nWidth() * 5
nHeight := oImage:nHeight() * 5
cFactor := "500 %"
ENDIF
DEFINE DIALOG oDlg TITLE cFactor FROM 50, 50 TO nHeight + 50, nWidth + 50 PIXEL // TRANSPARENT
oBrush := TBrush():new( ,,,, ResizeBmp( oImage:hBitmap, nWidth, nHeight, .T. ) )
oDlg:Setbrush( oBrush )
ACTIVATE DIALOG oDlg
oImage:End()
RETURN( NIL )
















I don't know how to do it, but I wanted to show de images from a TIFF file in the browse, like you do with the zoom. I have a multiple tiff files in a directori and when I choice the file it must to show all the images in a view mode not edit mode.
Also how you disegn the bottoms like the readfiles, zoom, .... and how do you do the type filter JPF, BMP,TIFF.... please?