Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Databases
»
[SOLVED] Read Picture from Postgresql Database Unknown Picture Format [blob]
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
is there PDS reader/expor...
by
jamie
[
Today
at 04:38:58 pm]
Fpcupdeluxe
by
DonAlfredo
[
Today
at 04:36:46 pm]
TDateTimePicker - Make th...
by
AlexanderT
[
Today
at 04:23:28 pm]
Help needed on how to do ...
by
paweld
[
Today
at 01:45:29 pm]
equivalent to C/C++ "offs...
by
jamie
[
Today
at 12:58:11 pm]
Source Editor Collapsed P...
by
J-G
[
Today
at 11:17:14 am]
Habari STOMP Clients for ...
by
mjustin
[
Today
at 11:15:54 am]
UI app to work with SQLit...
by
Tomu
[
Today
at 11:10:23 am]
Questions on slight diffe...
by
egsuh
[
Today
at 09:45:30 am]
Have anybody used Horse f...
by
egsuh
[
Today
at 08:31:21 am]
TCollection wiki entry
by
Thaddy
[
Today
at 07:06:53 am]
Printing on HP Smart Tank
by
jamie
[
Today
at 01:55:25 am]
Problems with creating a ...
by
jamie
[
Today
at 12:10:44 am]
val return code
by
Paolo
[July 10, 2026, 10:58:32 pm]
Gtk3 becomes default widg...
by
PascalDragon
[July 10, 2026, 09:59:25 pm]
Seeking performance feedb...
by
Xenno
[July 10, 2026, 04:31:34 pm]
Pls support Double Comman...
by
Alexx2000
[July 10, 2026, 04:02:56 pm]
Ignoring Exceptions - Hit...
by
Martin_fr
[July 10, 2026, 03:50:47 pm]
Lazarus 4.6 may erase you...
by
Benoni_Edin
[July 10, 2026, 01:22:02 pm]
Greyed out controls?
by
LeP
[July 10, 2026, 12:21:25 pm]
Creating binary
by
marcov
[July 10, 2026, 11:25:17 am]
Hello. I'm new to this co...
by
onionmixer
[July 10, 2026, 03:55:53 am]
Selecting from a list of ...
by
J-G
[July 09, 2026, 11:38:39 pm]
A recreation of the class...
by
count
[July 09, 2026, 08:53:45 pm]
GTK3 is now the default w...
by
bonmario
[July 09, 2026, 07:48:59 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] Read Picture from Postgresql Database Unknown Picture Format [blob] (Read 2182 times)
heejit
Full Member
Posts: 249
[SOLVED] Read Picture from Postgresql Database Unknown Picture Format [blob]
«
on:
March 19, 2019, 05:48:21 pm »
Code: Pascal
[Select]
[+]
[-]
Working
:
astream
:
TStream
astream
:
=
m_qry
.
CreateBlobStream
(
m_qry
.
FieldByName
(
'file_data'
)
,
bmRead
)
;
self
.
imgWidget
.
Picture
.
LoadFromStream
(
astream
)
;
Not
Working
:
Unknown Picture Format
astream
:
TMemoryStream
TBlobField
(
self
.
m_qry
.
FieldByName
(
'file_data'
)
)
.
SaveToStream
(
astream
)
;
self
.
imgWidget
.
Picture
.
LoadFromStream
(
astream
)
;
In documentation also it suggested to use TBlobField :
https://www.freepascal.org/docs-html/fcl/db/tdataset.createblobstream.html
Then why there is format Error?
Development Env:
Lazarus : 2.0
Feepascal : 3.0.4
SVN Rev : 60350M
OS : Linux 64bit Ubuntu 16.04
«
Last Edit: March 31, 2019, 03:10:00 pm by jshah
»
Logged
heejit
Full Member
Posts: 249
Re: Read Picture from Postgresql Database Unknown Picture Format [blob, postgresql]
«
Reply #1 on:
March 31, 2019, 03:09:37 pm »
Solved
We need to move the position of stream to beginning
astream.Position:=0;
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Databases
»
[SOLVED] Read Picture from Postgresql Database Unknown Picture Format [blob]
TinyPortal
© 2005-2018