Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #6877
| From | "Jamal" <someone@example.com> |
|---|---|
| Newsgroups | comp.lang.clipper.visual-objects |
| Subject | Re: Help - Manifest Breaks FabCtrl |
| Date | 2014-05-20 21:58 -0400 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <llh18e$hb2$1@speranza.aioe.org> (permalink) |
| References | (2 earlier) <2b948990-7762-4292-b4dc-6fbf40a40548@googlegroups.com> <lld8u5$1ru$1@speranza.aioe.org> <2cdd50da-222f-41a3-97c7-66f143972373@googlegroups.com> <lldfrn$l3c$1@speranza.aioe.org> <0b8f01b8-dd9e-41cd-a4cf-01b9ee462968@googlegroups.com> |
I updated your method to the following. My changes should be obvious.
METHOD GetPhoto(sImagePath) CLASS FotoWin
LOCAL cFileName, cNameOnServer as STRING
LOCAL oFS as FILESPEC
LOCAL nWidth, nHeight as LONG
LOCAL oImage as FabPaintLib // Jamal - Add this line to work with a
local variable
cFileName := AllTrim(sImagePath)
cNameOnServer := cFileName
IF Empty(cFileName)
self:oDCbmpPict:Hide()
RETURN nil
ELSE
IF ! Upper(SubStr(cProgramDir,1,1))$"CDEF"
cFileName := SubStr(cProgramDir,1,1) +
AllTrim(SubStr(cFileName,2,Len(cFileName) - 1) )
ENDIF
oFS := FileSpec{cFileName}
ENDIF
IF !
Upper(Right(cFileName,4))$".BMP,.JPG,JPEG,TIFF,.JPE,.DIB,.RLE,.JIF,.PNG,.PCT,.TIF,.EPS,.TGA,.WMF,.EMF,.PCX,.PGM,.GIF,.EPS"
cFileName := ""
ENDIF
IF ! Empty(cFileName)
self:Pointer := Pointer{ POINTERHOURGLASS }
self:oDCbmpPict:Hide()
IF File(cFileName)
oImage := FabPaintLib{ cFileName }
nWidth := oImage :width
nHeight := oImage:height
IF nWidth > 411 .or. nHeight > 284
DO WHILE nWidth > 411 .or. nHeight > 284
IF Integer(nWidth * .6) < 411
nWidth := Integer(nWidth * .99)
nHeight := Integer(nHeight * .99)
ELSE
nWidth := Integer(nWidth * .6)
nHeight := Integer(nHeight * .6)
ENDIF
ENDDO
oImage:ResizeBox( nWidth, nHeight, 1 )
ENDIF
self:oDCbmpPict:Show()
// SELF:oDCbmpPict:ImageFit := TRUE // Jamal - Optional if
you want Image Fit and forget about resizing
self:oDCbmpPict:Image := oImage // Jamal - Assign image
ENDIF
self:Pointer := Pointer{ POINTERARROW }
ELSE
self:oDCbmpPict:Hide()
ENDIF
CollectForced() // <--- Is this needed?
RETURN nil
HTH,
Jamal
"Kuno Egger" wrote in message
news:0b8f01b8-dd9e-41cd-a4cf-01b9ee462968@googlegroups.com...
The following code displays a photo in a FabPaintLibCtrl if the manifest is
NOT declared. As soon as the manifest is added back in the control remains
blank. Can you spot the offending code? If I comment out the lines that
resize large photos it still behaves the same.
------------------------------------------------------------------------
METHOD GetPhoto(sImagePath) CLASS FotoWin
LOCAL cFileName, cNameOnServer AS STRING
LOCAL oFS AS FILESPEC
LOCAL nWidth, nHeight AS LONG
cFileName := AllTrim(sImagePath)
cNameOnServer := cFileName
IF Empty(cFileName)
SELF:oDCbmpPict:Hide()
RETURN NIL
ELSE
IF ! Upper(SubStr(cProgramDir,1,1))$"CDEF"
cFileName := SubStr(cProgramDir,1,1) +
alltrim(SubStr(cFileName,2,len(cFilename) - 1) )
ENDIF
oFS := FileSpec{cFileName}
ENDIF
IF !
Upper(Right(cFileName,4))$".BMP,.JPG,JPEG,TIFF,.JPE,.DIB,.RLE,.JIF,.PNG,.PCT,.TIF,.EPS,.TGA,.WMF,.EMF,.PCX,.PGM,.GIF,.EPS"
cFileName := ""
ENDIF
IF ! Empty(cFileName)
SELF:Pointer := Pointer{ POINTERHOURGLASS }
SELF:oDCbmpPict:Hide()
IF File(cFileName)
SELF:oDCbmpPict:Image := FabPaintLib{ cFileName }
nWidth := SELF:oDCbmpPict:Image:width
nHeight := SELF:oDCbmpPict:Image:height
IF nWidth > 411 .OR. nHeight > 284
DO WHILE nWidth > 411 .OR. nHeight > 284
IF Integer(nWidth * .6) < 411
nWidth := Integer(nWidth * .99)
nHeight := Integer(nHeight * .99)
ELSE
nWidth := Integer(nWidth * .6)
nHeight := Integer(nHeight * .6)
ENDIF
ENDDO
SELF:oDCbmpPict:Image:ResizeBox( nWidth, nHeight, 1 )
ENDIF
SELF:oDCbmpPict:Show()
ENDIF
SELF:Pointer := Pointer{ POINTERARROW }
ELSE
SELF:oDCbmpPict:Hide()
ENDIF
CollectForced()
RETURN NIL
Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Help - Manifest Breaks FabCtrl Kuno Egger <kuno@retailsoftware.com> - 2014-05-15 20:22 -0700
Re: Help - Manifest Breaks FabCtrl "Jamal" <someone@example.com> - 2014-05-18 15:32 -0400
Re: Help - Manifest Breaks FabCtrl Kuno Egger <kuno@retailsoftware.com> - 2014-05-18 19:35 -0700
Re: Help - Manifest Breaks FabCtrl "Jamal" <someone@example.com> - 2014-05-19 11:45 -0400
Re: Help - Manifest Breaks FabCtrl Kuno Egger <kuno@retailsoftware.com> - 2014-05-19 10:26 -0700
Re: Help - Manifest Breaks FabCtrl "Jamal" <someone@example.com> - 2014-05-19 13:43 -0400
Re: Help - Manifest Breaks FabCtrl Kuno Egger <kuno@retailsoftware.com> - 2014-05-20 13:41 -0700
Re: Help - Manifest Breaks FabCtrl "Jamal" <someone@example.com> - 2014-05-20 16:57 -0400
Re: Help - Manifest Breaks FabCtrl Kuno Egger <kuno@retailsoftware.com> - 2014-05-20 16:42 -0700
Re: Help - Manifest Breaks FabCtrl "Jamal" <someone@example.com> - 2014-05-20 21:32 -0400
Re: Help - Manifest Breaks FabCtrl "Jamal" <someone@example.com> - 2014-05-20 21:58 -0400
Re: Help - Manifest Breaks FabCtrl Kuno Egger <kuno@retailsoftware.com> - 2014-05-22 19:00 -0700
Re: Help - Manifest Breaks FabCtrl "Jamal" <someone@example.com> - 2014-05-23 12:21 -0400
csiph-web