| Author |
Image display in image field
|
|
| John Jay 2005-11-03, 8:24 pm |
| Hi All,
I need to display thousands of images in a form, one at a time. They are
copies of pages in books. Each book has has a part number. Each file is a
page (or patrial page forom the book. All tif files. Unfortunetly they do
not have the .tif extention. The files use the books part number as the the
file name, then the page number as the extention. an example is 172474.01 as
book number 172474 page number 1. 172474.02 as page number 2 ect. I can
display them using a Kodak active X in win 98 through 2000, but XP does not
come with Kodak. Typing in the command pane Restore image from 172474.01
type tif. gives me Error unexpected type: 172474.01 . I can copy the file
to the clipboard then past them into a binary field of a table and it
displays on the form so the issue is not that Plus 2.5 cannot display the
image. Does anyone have suggestion how to macro like
cMacro="form.image.datasource = "+form.rowset.fields["image".].value
&cMacro
Or how I can programmictly load the image into a binary field in a table?
I can loop through the files with a=new Array() but OLH shows how to copy
from a field to a table not copy image to field.
Tia
John Jay
Best Marine
| |
| Christopher F. Neumann 2005-11-03, 8:24 pm |
| can you rename the files to 172474.01.tif?
--
Christopher F. Neumann
[dBASE Gold Charter Member 107]
Blue Star Visual dBASE graduate
IWA-HWG Web Technologies Certified
IWA-HWG Web Programming Certified
ICCP TCP/IP Network Analyst
Data Communications Engineer
http://cfneumann.us
"Just hanging out on the Sagittarian arm of the Milky Way"
John Jay wrote:
> Hi All,
> I need to display thousands of images in a form, one at a time.
> They are copies of pages in books. Each book has has a part number.
> Each file is a page (or patrial page forom the book. All tif files.
> Unfortunetly they do not have the .tif extention. The files use the
> books part number as the the file name, then the page number as the
> extention. an example is 172474.01 as book number 172474 page number
> 1. 172474.02 as page number 2 ect. I can display them using a Kodak
> active X in win 98 through 2000, but XP does not come with Kodak.
> Typing in the command pane Restore image from 172474.01 type tif.
> gives me Error unexpected type: 172474.01 . I can copy the file to
> the clipboard then past them into a binary field of a table and it
> displays on the form so the issue is not that Plus 2.5 cannot display
> the image. Does anyone have suggestion how to macro like
> cMacro="form.image.datasource = "+form.rowset.fields["image".].value
> &cMacro
> Or how I can programmictly load the image into a binary field in a
> table? I can loop through the files with a=new Array() but OLH shows
> how to copy from a field to a table not copy image to field.
> Tia
> John Jay
> Best Marine
| |
| John Jay 2005-11-03, 8:24 pm |
|
Christopher ,
I tried that from the command pane a while ago and got the unexpected
type: error.
But your post made me try to enter it directly inot the
form.image1.datasource
Alas same error.
Good thought. Thanks
John Jay
Best Marine
| |
| evilaro 2005-11-03, 8:24 pm |
| John:
> form.image1.datasource
If the file you are trying to look is a .tif
the image object can not.
it would have to be a jpg bmp pcx gif an some others...
I remember the image object could see a special type of
tif but not he standard.
If my memory serves.
Emilio
"John Jay" < beat_nospam_mar@sbcg
lobal.net> escribió en el mensaje
news:7vZS7QM4FHA.1236@news-server...
>
> Christopher ,
> I tried that from the command pane a while ago and got the unexpected
> type: error.
> But your post made me try to enter it directly inot the
> form.image1.datasource
> Alas same error.
> Good thought. Thanks
>
> John Jay
> Best Marine
>
>
>
>
| |
| John Jay 2005-11-03, 8:24 pm |
|
Christopher ,
> can you rename the files to 172474.01.tif?
I renamed the file then Typed in the command pane Restore image from
172474.01.tif type tif.gives me Error unexpected type: Putting the
filename into form.image1.datasource and you get the same error.
I then renamed the file 172474.tif and got the same error in the command
pane and the form.image1.datasource. This leds me to beleive I have a
unsupported tif compression type that is somehow overcome when I put the
image into a Binary field of a level 7 table.
Is possible to use the IE image displaying program to acomplish this? Or
the Fax viewer that comes with XP?
John Jay
Best Marine
| |
| Ronnie MacGregor 2005-11-03, 8:24 pm |
| In article <ZyPakOL4FHA.1036@news-server>, beat_nospam_mar@sbcg
lobal.net
says...
> I can
> display them using a Kodak active X in win 98 through 2000, but XP does not
> come with Kodak.
It is possible to get the Kodak activeX working under XP.
Contact me offline if you need a "howto".
--
Ronnie MacGregor
Scotland
www.dBASEdeveloper.co.uk
| |
| John Jay 2005-11-03, 8:24 pm |
|
Ronnie '
> Contact me offline if you need a "howto".
Will doThanks.
I will also include the "HotSpot.cc" demo we worked on. I have tested it
enough to show it.
John Jay
Best Marine
| |
| David Stone 2005-11-03, 8:24 pm |
| John Jay wrote:
> I can copy the file to the clipboard then past them into a binary field of a
> table and it
> displays on the form
Hi John, have you been able to do the above sequence programmatically, or are
you doing it manually with Ctrl-v when the pic viewer is open?
David
| |
| John Jay 2005-11-04, 11:23 am |
|
"> Hi John, have you been able to do the above sequence programmatically, or
are
> you doing it manually with Ctrl-v when the pic viewer is open?
David,
I have no idea how to load an image contained in a file into the clipboard
programmatically, but if I did I think I could put it into the binary field
with some testing.
To put the image into the binary field I:
Opened Kodak Image
opened the file
Selected the whole image
Copied it to the clipboard
whent back to Plus
selected the binary field
pasted the image into the field when the viewer was open by right clicking
and selecting paste.
A bit much to do thousands of times.
John Jay
Best Marine
| |
| David Stone 2005-11-04, 1:23 pm |
| John Jay wrote:
> I have no idea how to load an image contained in a file into the clipboard
> programmatically, but if I did I think I could put it into the binary field
> with some testing.
> Opened Kodak Image
> opened the file
> Selected the whole image
> Copied it to the clipboard
> went back to Plus
John, thanks for the info. If you can figure out how to do the steps below
programmatically, there are several folks here who would be very interested to
hear about it.
> selected the binary field
> pasted the image into the field when the viewer was open by right clicking
> and selecting paste.
> A bit much to do thousands of times.
No kidding ;-). The paste seems to depend on the viewer being open, and I don't
know if any properties/methods (paste, for example) of the viewer are available
to us.
David
| |
| John Jay 2005-11-04, 8:23 pm |
|
David ,
.. If you can figure out how to do the steps below
> programmatically, there are several folks here who would be very
interested to[color=darkred]
> hear about it.
>
clicking[color=darkr
ed]
Create a table named binpaste 1 field binary
save it
run the form below
then see if you can save the entry
John
** END HEADER -- do not remove this line
//
// Generated on 11/04/2005
//
parameter bModal
local f
f = new BinPasteForm()
if (bModal)
f.mdi = false // ensure not MDI
f.readModal()
else
f.open()
endif
class BinPasteForm of FORM
with (this)
metric = 6 // Pixels
height = 745.0
left = 0.0
top = 0.0
width = 1028.0
view = "BinPaste.dbf"
endwith
this.BROWSE1 = new BROWSE(this)
with (this.BROWSE1)
height = 319.0
left = 28.0
top = 66.0
width = 756.0
alias = "BINPASTE"
endwith
this.PUSHBUTTON2 = new PUSHBUTTON(this)
with (this.PUSHBUTTON2)
onClick = class::PUSHBUTTON2_O
NCLICK
height = 24.0
left = 231.0
top = 11.0
width = 107.0
text = "Pushbutton2"
endwith
function PUSHBUTTON2_onClick
select binpaste
append blank
cCmd= " restore image from binary image timeout 5";keyboard( "{Ctrl+v}")
&cCmd
return
endclass
| |
| John Jay 2005-11-04, 8:23 pm |
|
David ,
Was intrupped and did not finish the last post.
Be sure to copy an image into the clipboard THEN run the form.
John Jay
BestMarine
| |
| Ivar B. Jessen 2005-11-04, 8:23 pm |
| On Thu, 3 Nov 2005 12:11:40 -0800, "John Jay"
< beat_nospam_mar@sbcg
lobal.net> wrote:
>Hi All,
> I need to display thousands of images in a form, one at a time. They are
>copies of pages in books. Each book has has a part number. Each file is a
>page (or patrial page forom the book. All tif files. Unfortunetly they do
>not have the .tif extention. The files use the books part number as the the
>file name, then the page number as the extention. an example is 172474.01 as
>book number 172474 page number 1. 172474.02 as page number 2 ect. I can
>display them using a Kodak active X in win 98 through 2000, but XP does not
>come with Kodak. Typing in the command pane Restore image from 172474.01
>type tif. gives me Error unexpected type: 172474.01 . I can copy the file
>to the clipboard then past them into a binary field of a table and it
>displays on the form so the issue is not that Plus 2.5 cannot display the
>image. Does anyone have suggestion how to macro like
>cMacro="form.image.datasource = "+form.rowset.fields["image".].value
>&cMacro
>Or how I can programmictly load the image into a binary field in a table?
>I can loop through the files with a=new Array() but OLH shows how to copy
>from a field to a table not copy image to field.
Could you use the batch conversion/batch renaming feature of IrfanView to
first convert all the tif files to a format that dbase understands and then
programmatically load the converted images into a blob field of a table?
Ivar B. Jessen
| |
| David Stone 2005-11-04, 8:23 pm |
| John Jay wrote:
> Be sure to copy an image into the clipboard THEN run the form.
>
John, that works! How simple and elegant! For some reason I keep
forgetting how useful the keyboard( ) command is.
Thanks very much.
David
| |
| John Jay 2005-11-04, 8:23 pm |
|
Ivar
> Could you use the batch conversion/batch renaming feature of IrfanView to
> first convert all the tif files to a format that dbase understands and
then
> programmatically load the converted images into a blob field of a table?
I downloaded Irfan View and will check it out. But see my last 2 posts
they are as far as I can get to programmatically load the converted images
into a blob field .
Any suggestions on my form or another way to do it?
Thanks
John Jay
Best Marine
| |
| John Jay 2005-11-04, 8:23 pm |
|
David
> John, that works! How simple and elegant! For some reason I keep
> forgetting how useful the keyboard( ) command is.
My post that included the form ended with
run the form below
then see if you can save the entry
Pease recheck your work. In my test I could Not save the image even though
it was displayed in the viewer. It also displayed in the browse, but went
back to empty after you moved off the record. Are you saying it was saved
in your test????
Look at my second reply to Ivar, his suggestion solved my problem much
easier for my needs.
Thanks
John Jay
Best Marine
| |
| John Jay 2005-11-04, 8:23 pm |
|
Ivar
> Could you use the batch conversion/batch renaming feature of IrfanView to
> first convert all the tif files to a format that dbase understands and
then
> programmatically load the converted images into a blob field of a table?
Problem Solved! Using the freeware Irfan View you suggested. It has a
command line option that works perfectly for me.
All I have to do is loop through the table containing the image file names
and;
cCmd=[run(.t., c:\program files\IrfanView\i_vi
ew32.exe
c:\mydir\]+form.rowset.fields["picturefil"].value+"
/convert=c:\mydir\"+newfilename.jpg +[")]
&cCmd
In the command pane it worked flawlessly.
I can display the converted images in my form using Plus's regular image
control without the need for any other tool.
Thanks again
John Jay
Best Marine
| |
| Ivar B. Jessen 2005-11-05, 3:23 am |
| On Fri, 4 Nov 2005 18:02:02 -0800, "John Jay"
< beat_nospam_mar@sbcg
lobal.net> wrote:
>
>Ivar
>then
>
>Problem Solved! Using the freeware Irfan View you suggested. It has a
>command line option that works perfectly for me.
>All I have to do is loop through the table containing the image file names
>and;
> cCmd=[run(.t., c:\program files\IrfanView\i_vi
ew32.exe
>c:\mydir\]+form.rowset.fields["picturefil"].value+"
>/convert=c:\mydir\"+newfilename.jpg +[")]
>&cCmd
>
>In the command pane it worked flawlessly.
>I can display the converted images in my form using Plus's regular image
>control without the need for any other tool.
>Thanks again
Thanks for the success report. I use a similar type of code to left-rotate
and reduce the size of many of my digital photos.
Ivar B. Jessen
| |
| David Stone 2005-11-05, 3:23 am |
| John Jay wrote:
> Pease recheck your work. In my test I could Not save the image even though
> it was displayed in the viewer. It also displayed in the browse, but went
> back to empty after you moved off the record. Are you saying it was saved
> in your test????
It saved about half of the images. I haven't tried this with OODML
yet---perhaps it will work more reliably.
> Look at my second reply to Ivar, his suggestion solved my problem much
> easier for my needs.
Yes, I see that---much easier and avoids use of a binary field and duplication
of image data. Still, it'd be nice to have a programmatic way to get images
from the clipboard into a binary field, and your approach is the simplest. I'll
let you know if I find a way around the save problem.
David
| |
| John Jay 2005-11-08, 9:24 am |
|
David
> It saved about half of the images.
You had some that were saved, what did you do different to get them saved?
I haven't tried this with OODML yet---perhaps it will work more reliably.
I started with a Grid and OODML but had no success getting focus() to the
field, looked at OLH and it led me to my browse form.
> Yes, I see that---much easier and avoids use of a binary field and
duplication
> of image data. Still, it'd be nice to have a programmatic way to get
images
> from the clipboard into a binary field, and your approach is the simplest.
That will solve half of the problem. How to programmaticcally get the images
from a file to the clipboard seems to be the biggest hurdle we face.
>I'll let you know if I find a way around the save problem.
Thanks, I am going to follow the convert idea, Ivar's suggestion will allow
me to
convert my program to all versions of Win in a few hours therby solving
something I have been strggling with for years.
John Jay
Best Marine
| |
| David Stone 2005-11-08, 9:24 am |
| John Jay wrote:
> You had some that were saved, what did you do different to get them saved?
I haven't explored it yet, and it wasn't obvious what the difference
was...hoping to figure it out.
> That will solve half of the problem. How to programmaticcally get the images
> from a file to the clipboard seems to be the biggest hurdle we face.
Although if it's already an image file, the image can be snagged directly into a
binary field (well, assuming file-type compatibility).
A few years ago I was trying to use Excel (via OLE automation) to create a graph
that could be copied to the clipboard and then auto-pasted into a binary field
in dBASE, thus utilizing the considerable graphing capabilities of Excel. This
has come up again a few days ago in another thread, so that's my interest in
getting a paste mechanism worked out.
David
| |
| John Jay 2005-11-08, 9:24 am |
| David
> I haven't explored it yet, and it wasn't obvious what the difference
> was...hoping to figure it out.
> A few years ago I was trying to use Excel (via OLE automation) to create a
graph
> that could be copied to the clipboard and then auto-pasted into a binary
field
> in dBASE, thus utilizing the considerable graphing capabilities of Excel.
This
> has come up again a few days ago in another thread, so that's my interest
in
> getting a paste mechanism worked out.
When I am in the dbase ide mode and copy a file to the clipboard (usually
using MS Paint or Kodak Image), then;
use myfile
append
select the binary field field
select binary field type in the window that pops up
right click and paste in the viewer
the viewre window expands to the size of the image.
Using keyboard in my form the image window does not expand, but you can
see that the image is there and the field in my browse changes from the dots
indicating a empty field to the image picture. But when I close image viewer
in my form the image is not saved and the brows reverts to the emty field
dots..
So my questions are ;
1. Is this the image viewer window a Db form that Db has control of ?
2. Is the form a Win form accesed by a API or other method using Api Calls?
3. Is ita combination of both ?
4. Can we use some kind of direct non form method/procedure to do the job?
If you do not know the answers I am going to start a new thread in
programming and ask these queations, Then if needed reask in
dbase.ddd-ole-dll-win API news group.
JohnJay
Best Marine
| |
| David Stone 2005-11-08, 9:24 am |
| John Jay wrote:
> When I am in the dbase ide mode and copy a file to the clipboard (usually
> using MS Paint or Kodak Image), then;
> use myfile
> append
> select the binary field field
> select binary field type in the window that pops up
> right click and paste in the viewer
> the viewre window expands to the size of the image.
Same here...
> Using keyboard in my form the image window does not expand, but you can
> see that the image is there and the field in my browse changes from the dots
> indicating a empty field to the image picture. But when I close image viewer
> in my form the image is not saved and the brows reverts to the emty field
> dots..
Mine does that about half the time. I have been trying to get this to work with
OODML and I'm having no luck at all so far.
> So my questions are ;
> 1. Is this the image viewer window a Db form that Db has control of ?
It's dBASE opening it, but we would only have API access to it, and that would
prob. be of limited use.
> 2. Is the form a Win form accesed by a API or other method using Api Calls?
Do you mean is it a form opened by the OS? It appears to be a form created by
dBASE whose attributes have not been surfaced for our use. Hopefully someone has
tried to use API to manipulate the viewer form (if nothing else, to set focus to
it).
> 3. Is ita combination of both ?
> 4. Can we use some kind of direct non form method/procedure to do the job?
>
> If you do not know the answers
Not in a useful way--;-). Yes, start a new thread.
D.
| |
| John Jay 2005-11-08, 3:58 pm |
|
David
On aug 21 1999 there was this post
>Ed Matthews wrote:
> Does anyone know a way to move a BMP image from a DLL into a Binary
> field.
>
> Usually you fill a binary field with: REPLACE BINARY
> CUSTOMER->CIMAGE FROM XYZ.BMP
The Obvious thing I foegot to do OLH Replace Binary
it also has a OODML method
Opps
John Jay
Best marine
| |
| David Stone 2005-11-09, 3:23 am |
| John Jay wrote:
> The Obvious thing I foegot to do OLH Replace Binary
> it also has a OODML method
Yeh, but does it work with pasting from the clipboard using keyboard(
"{Ctrl+v}")? Nope...not yet, anyway.
David
|
|
|
|