Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #12881 > unrolled thread
| Started by | Gunter <rhsteinfurth@gmail.com> |
|---|---|
| First post | 2020-03-02 02:34 -0800 |
| Last post | 2020-03-17 01:05 -0700 |
| Articles | 12 — 5 participants |
Back to article view | Back to comp.lang.clipper.visual-objects
A short question: Gunter <rhsteinfurth@gmail.com> - 2020-03-02 02:34 -0800
Re: A short question: Franz Rachbauer <office@rachbauer.org> - 2020-03-02 12:17 +0100
Re: A short question: sherlocksoftware@gmail.com - 2020-03-10 08:58 -0700
Re: A short question: Franz Rachbauer <office@rachbauer.org> - 2020-03-11 05:58 +0100
Re: A short question: rhsteinfurth@gmail.com - 2020-03-02 05:56 -0800
Re: A short question: Franz Rachbauer <office@rachbauer.org> - 2020-03-02 18:04 +0100
Re: A short question: rhsteinfurth@gmail.com - 2020-03-03 02:12 -0800
Re: A short question: Franz Rachbauer <office@rachbauer.org> - 2020-03-03 12:27 +0100
Re: A short question: rhsteinfurth@gmail.com - 2020-03-06 08:58 -0800
Re: A short question: Franz Rachbauer <office@rachbauer.org> - 2020-03-06 20:22 +0100
Re: A short question: Stefan Überbacher <info@sanosoft.com> - 2020-03-09 00:05 -0700
Re: A short question: rhsteinfurth@gmail.com - 2020-03-17 01:05 -0700
| From | Gunter <rhsteinfurth@gmail.com> |
|---|---|
| Date | 2020-03-02 02:34 -0800 |
| Subject | A short question: |
| Message-ID | <035266d8-49a2-491d-9951-013ab945d6e0@googlegroups.com> |
How do I display icons in a cell of the bBrowser? The file name of the icon is in the connected DBF. The icons have different resolutions. Thanks in advance. Gunter
[toc] | [next] | [standalone]
| From | Franz Rachbauer <office@rachbauer.org> |
|---|---|
| Date | 2020-03-02 12:17 +0100 |
| Message-ID | <r3iq0d$9ff$1@gioia.aioe.org> |
| In reply to | #12881 |
I do this with JPG, read from file, convert to bmp and show in bBrowser.
Hope this helps.
Franz
// Define col IMAGE
oColumn := bDataColumn{SELF:oDCBrowser, _oDbf, {|Server, Owner|
Owner:GetImage(Server)}, #Expression, SELF}
oColumn:Caption := "Image"
oColumn:ValType := "O"
oColumn:Alignment := BALIGN_CENTER
oColumn:Width := 100
oColumn:SuspendEmptyValues := TRUE
METHOD GetImage(oServer) CLASS dlgLeft
// Get Image with filename from dbf recno
LOCAL cFile AS STRING
LOCAL cString AS STRING
LOCAL oImage AS Bitmap
LOCAL oBild AS FabPaintLib
cFile := GetGlobal(#TMP) + "~LC" + StrZero(oServer:Recno,5) + ".JPG"
IF File(cFile)
oBild := FabPaintLib { cFile , SELF }
oBild:ResizeBilinear(100, Round(FLOAT(_HEIGHT)/FLOAT(_WIDTH)*100,0))
oBild:AsStringFileFormat := "BMP"
cString := oBild:AsString
oImage := bBitmap{bimgCreateBitmapFromDibString(, cString)}
ENDIF
RETURN oImage
Am 02.03.2020 um 11:34 schrieb Gunter:
> How do I display icons in a cell of the bBrowser? The file name of the icon is in the connected DBF. The icons have different resolutions.
> Thanks in advance.
> Gunter
>
[toc] | [prev] | [next] | [standalone]
| From | sherlocksoftware@gmail.com |
|---|---|
| Date | 2020-03-10 08:58 -0700 |
| Message-ID | <0b3a3025-6193-4c58-bd20-a24042a39ba3@googlegroups.com> |
| In reply to | #12882 |
snip[ Franz Rachbauer wrote: I do this with JPG, read from file, convert to bmp and show in bBrowser. ]
You do not have to convert JPG to BMP.. this is the trick.
You must put in Libaries included "MUST HAVE" FabPaintLin 3.0.15 in first position [ top ] of the list.
JPG as DIB then print using _DrawBMP which prints the DIB object.
IF File( cFileJPG )
oDib := FabPaintLib{ cFileJPG , oPrinter }
IF oDib:Isvalid
//
IF oDib:Height > oDib:Width
// if a PORTRAIT/VERTICAL photo verse LANDSCAPE/HORIZONTAL
oDib:Rotate( -300.023,0) // 90 degree rotation..
ENDIF
//
oPrinter:_DrawBMP( 8,0, oDib, 32*1.23, 48*1.23,,,TRUE )
[toc] | [prev] | [next] | [standalone]
| From | Franz Rachbauer <office@rachbauer.org> |
|---|---|
| Date | 2020-03-11 05:58 +0100 |
| Message-ID | <r49r5b$1dtr$1@gioia.aioe.org> |
| In reply to | #12919 |
Hi Phil,
the original question was to show icons in bBrowser <g>
Franz
Am 10.03.2020 um 16:58 schrieb sherlocksoftware@gmail.com:
> snip[ Franz Rachbauer wrote: I do this with JPG, read from file, convert to bmp and show in bBrowser. ]
>
> You do not have to convert JPG to BMP.. this is the trick.
> You must put in Libaries included "MUST HAVE" FabPaintLin 3.0.15 in first position [ top ] of the list.
> JPG as DIB then print using _DrawBMP which prints the DIB object.
>
> IF File( cFileJPG )
> oDib := FabPaintLib{ cFileJPG , oPrinter }
> IF oDib:Isvalid
> //
> IF oDib:Height > oDib:Width
> // if a PORTRAIT/VERTICAL photo verse LANDSCAPE/HORIZONTAL
> oDib:Rotate( -300.023,0) // 90 degree rotation..
> ENDIF
> //
> oPrinter:_DrawBMP( 8,0, oDib, 32*1.23, 48*1.23,,,TRUE )
>
[toc] | [prev] | [next] | [standalone]
| From | rhsteinfurth@gmail.com |
|---|---|
| Date | 2020-03-02 05:56 -0800 |
| Message-ID | <7f0632fc-bd70-4f61-bd0c-190a6149f740@googlegroups.com> |
| In reply to | #12881 |
Am Montag, 2. März 2020 10:34:17 UTC schrieb Gunter:
> How do I display icons in a cell of the bBrowser? The file name of the icon is in the connected DBF. The icons have different resolutions.
> Thanks in advance.
> Gunter
Thanks for your quick reply.
But i have problems with the row:
oImage := bBitmap{ bimgCreateBitmapFromDibString( , cString)}
what a class is bBitmap and what is bimgCreateBitmapFromDibString()
And what means 'Round( FLOAT( _HEIGHT) / FLOAT( _WIDTH) * 100, 0)'?
[toc] | [prev] | [next] | [standalone]
| From | Franz Rachbauer <office@rachbauer.org> |
|---|---|
| Date | 2020-03-02 18:04 +0100 |
| Message-ID | <r3jea1$1f3t$1@gioia.aioe.org> |
| In reply to | #12884 |
Hi,
you find the class bBitmap and the function
bimgCreateBitmapFromDibString in bSample - Images which you installed
with bBrowser (see subdir samples).
The line oBild:ResizeBilinear only resizes the large image to a smaller
one using the defined values _HEIGHT and _WIDTH.
Regards, Franz
Am 02.03.2020 um 14:56 schrieb rhsteinfurth@gmail.com:
> Am Montag, 2. März 2020 10:34:17 UTC schrieb Gunter:
>> How do I display icons in a cell of the bBrowser? The file name of the icon is in the connected DBF. The icons have different resolutions.
>> Thanks in advance.
>> Gunter
>
> Thanks for your quick reply.
> But i have problems with the row:
> oImage := bBitmap{ bimgCreateBitmapFromDibString( , cString)}
> what a class is bBitmap and what is bimgCreateBitmapFromDibString()
> And what means 'Round( FLOAT( _HEIGHT) / FLOAT( _WIDTH) * 100, 0)'?
>
[toc] | [prev] | [next] | [standalone]
| From | rhsteinfurth@gmail.com |
|---|---|
| Date | 2020-03-03 02:12 -0800 |
| Message-ID | <69ee4418-25f7-4228-bade-a89eab5aaf23@googlegroups.com> |
| In reply to | #12881 |
Am Montag, 2. März 2020 10:34:17 UTC schrieb Gunter: > How do I display icons in a cell of the bBrowser? The file name of the icon is in the connected DBF. The icons have different resolutions. > Thanks in advance. > Gunter Hi, Franz, it works. I only rename the .ico to .jpg ( or .bmp) and the METHOD GetImage() shows the image. But only icon Files with an resolution of 32 x 32 pixel. An Icon with 144 x 144 Pixel I have to change to 32 x 32 (e.g. with Paint). That is very cumbersome but a possibility. The Variable _HEIGHT and _WIDTH I couldn't find, I took a fixed value. Maybe you still have an idea to change the resolution of the icon file by program. otherwise I thank you very much for your help. Gunter
[toc] | [prev] | [next] | [standalone]
| From | Franz Rachbauer <office@rachbauer.org> |
|---|---|
| Date | 2020-03-03 12:27 +0100 |
| Message-ID | <r3leus$11k4$1@gioia.aioe.org> |
| In reply to | #12888 |
Hi Gunter, the vars _HEIGHT and _WIDTH are constants (397 and 283) to calc the Y size for a given X of 100, so all images are of same width. FabPaintLib should read ico files directly without renaming as you can see in method FabPaintLib.CreateFromFile. The resize you can do with oBild:ResizeBilinear(32, 32). Franz Am 03.03.2020 um 11:12 schrieb rhsteinfurth@gmail.com: > Am Montag, 2. März 2020 10:34:17 UTC schrieb Gunter: >> How do I display icons in a cell of the bBrowser? The file name of the icon is in the connected DBF. The icons have different resolutions. >> Thanks in advance. >> Gunter > > Hi, Franz, > it works. I only rename the .ico to .jpg ( or .bmp) and the METHOD GetImage() shows the image. > But only icon Files with an resolution of 32 x 32 pixel. > An Icon with 144 x 144 Pixel I have to change to 32 x 32 (e.g. with Paint). > That is very cumbersome but a possibility. > The Variable _HEIGHT and _WIDTH I couldn't find, I took a fixed value. > Maybe you still have an idea to change the resolution of the icon file by program. otherwise I thank you very much for your help. > Gunter >
[toc] | [prev] | [next] | [standalone]
| From | rhsteinfurth@gmail.com |
|---|---|
| Date | 2020-03-06 08:58 -0800 |
| Message-ID | <7b03d71a-d986-4f0b-a606-85eba70062fe@googlegroups.com> |
| In reply to | #12881 |
Am Montag, 2. März 2020 10:34:17 UTC schrieb Gunter:
> How do I display icons in a cell of the bBrowser? The file name of the icon is in the connected DBF. The icons have different resolutions.
> Thanks in advance.
> Gunter
Hi, Franz,
I don't want to display any icons, but 'InternetShortcuts' (see 'IconFile=C:\...' in .URL files in the desktop directory)
It works for some, but not for most: FabPaintLib {cImgDatei,} -> IsValid = False.
The icon files are displayed correctly in WINDOWs Paint.
What kind of icon are they?
Gunter
[toc] | [prev] | [next] | [standalone]
| From | Franz Rachbauer <office@rachbauer.org> |
|---|---|
| Date | 2020-03-06 20:22 +0100 |
| Message-ID | <r3u7t9$5ee$1@gioia.aioe.org> |
| In reply to | #12906 |
Hi Gunter,
sorry but I can't answer your question, cause I only worked with jpg and
bmp. But you are able to ask Fabrice directly who made FabPaintLib: use
his homepage or X# Forum for this.
Regards, Franz
Am 06.03.2020 um 17:58 schrieb rhsteinfurth@gmail.com:
> Am Montag, 2. März 2020 10:34:17 UTC schrieb Gunter:
>> How do I display icons in a cell of the bBrowser? The file name of the icon is in the connected DBF. The icons have different resolutions.
>> Thanks in advance.
>> Gunter
>
> Hi, Franz,
> I don't want to display any icons, but 'InternetShortcuts' (see 'IconFile=C:\...' in .URL files in the desktop directory)
> It works for some, but not for most: FabPaintLib {cImgDatei,} -> IsValid = False.
> The icon files are displayed correctly in WINDOWs Paint.
> What kind of icon are they?
>
> Gunter
>
[toc] | [prev] | [next] | [standalone]
| From | Stefan Überbacher <info@sanosoft.com> |
|---|---|
| Date | 2020-03-09 00:05 -0700 |
| Message-ID | <fedc298f-1905-46b5-848e-c561763e0142@googlegroups.com> |
| In reply to | #12881 |
Hi,
the bBrowser allows you to draw the content of a cell yourself. DrawValue is the callback-method that the bBrowser invokes. This example assumes a size of 16x16 and cIcon is the file name.
oColumn:ViewValueAs := #Abstract
method DrawValue(oEvent) class MyWindow
local rc as _winRect
local hDC as ptr
local hIcon as ptr
local cIcon as string
local nX as int
local nY as int
hDC := oEvent:DeviceContext
rc := oEvent:Area
// horizontal zentrieren
nX := rc.left + Max(0, ((rc.right - rc.left - 16) / 2))
nY := rc.top
if !Empty(cIcon)
hIcon := LoadImage(_GetInst(), psz(_cast, cIcon), IMAGE_ICON, 16, 16, 0)
if hIcon != null_ptr
DrawState(hDC, null_ptr, null_ptr, long(_cast, hIcon), 0, nX, nY, 0, 0, DST_ICON + DSS_NORMAL)
DestroyIcon(hIcon)
endif
endif
return nil
[toc] | [prev] | [next] | [standalone]
| From | rhsteinfurth@gmail.com |
|---|---|
| Date | 2020-03-17 01:05 -0700 |
| Message-ID | <cb021465-8005-4b47-a9b1-1d20bbdb0493@googlegroups.com> |
| In reply to | #12881 |
Am Montag, 2. März 2020 10:34:17 UTC schrieb Gunter: > How do I display icons in a cell of the bBrowser? The file name of the icon is in the connected DBF. The icons have different resolutions. > Thanks in advance. > Gunter Hi Franz that's right. And especially those that arise when you drag a link to a website onto the desktop in Mozilla FireFox! The resulting icon is referenced in an .URL file in the desktop directory. Gunter
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.clipper.visual-objects
csiph-web