Board index » delphi » how to Update JPEG to InterBase BLOB Field ?

how to Update JPEG to InterBase BLOB Field ?

I am use IBX update InterBase V6.01 for Windows open source version
myself writing new VCL Update JPEG to BLOB field and Display,  this new VCL use at BDE no problem, but using IBX update BLOB field show error message "bitmap image is not valid"  why ?

my New VCL source code:

var FJpeg: TJPEGImage;
      FStream :  TMemoryStream;
begin
  FStream := TMemoryStream.Create;
  try
    if (Picture.Graphic is TBitmap) then
    begin
      FJpeg.Assign(Picture.Graphic);
      FJpeg.SaveToStream(FStream);  
//      FJpeg.SaveToFile('\TEST.JPG');   // check is JPEG file format

      if FDataLink.Field.IsBlob then
      begin
        FStream.Seek(soFromBeginning, 0);
        TBlobField(FDataLink.Field).LoadFromStream(FStream);   // this line use IBX update error
      end;
    end else
      FDataLink.Field.Clear;
  finally
    FStream.Free;
  end;
end;

 

Re:how to Update JPEG to InterBase BLOB Field ?


Please do not post in HTML.  Netscape showed your post as blank.

--
Jeff Overcash (TeamB)
      (Please do not email me directly unless  asked. Thank You)
Anyone who cannot cope with mathematics is not fully human.
At best he is a tolerable subhuman who has learned to wear
shoes, bathe and not make messes in the house.   (Heinlein)

Re:how to Update JPEG to InterBase BLOB Field ?


Quote
clipe wrote in message <3af3ca6b_1@dnews>...

I am use IBX update InterBase V6.01 for Windows open source version
myself writing new VCL Update JPEG to BLOB field and Display,  this new
VCL use at BDE no problem, but using IBX update BLOB field show error
message "bitmap image is not valid"  why ?

var FJpeg: TJPEGImage;
      FStream :  TMemoryStream;
begin
  FStream := TMemoryStream.Create;
  try
    if (Picture.Graphic is TBitmap) then
    begin
      FJpeg.Assign(Picture.Graphic);
<<<
I do not see the JPEGImage component being created. Try creating it:

    FJpeg := TJPEGImage.Create;

P.S. Please post in plain text only, no html.
--
Wayne Niddery (WinWright Inc.)
RADBooks - http://members.home.net/wniddery/RADBooks/delphibooks.html
"At the apex of every great tragedy of mankind there stands the figure
of an incorruptible altruist" - Ayn Rand

Re:how to Update JPEG to InterBase BLOB Field ?


I am sorry ! E-mail post again. (Text Mode)
I am use IBX update InterBase V6.01 for Windows open source version
myself writing new VCL Update JPEG to BLOB field and Display,  this new VCL
use at BDE no problem, but using IBX update BLOB field show error message
"bitmap image is not valid"  why ?

my New VCL source code:

var FJpeg: TJPEGImage;
      FStream :  TMemoryStream;
begin
  FStream := TMemoryStream.Create;
  try
    if (Picture.Graphic is TBitmap) then
    begin
       FJpeg := TJPEGImage.Create;
       try
         FJpeg.Assign(Picture.Graphic);
         FJpeg.SaveToStream(FStream);
//         FJpeg.SaveToFile('\TEST.JPG');   // check is JPEG file format

         if FDataLink.Field.IsBlob then
         begin
           FStream.Seek(soFromBeginning, 0);
           TBlobField(FDataLink.Field).LoadFromStream(FStream);   // this
line use IBX update error
         end;
       finally
          FJpeg .Free;
       end;
    end else
      FDataLink.Field.Clear;
  finally
    FStream.Free;
  end;
end;

Re:how to Update JPEG to InterBase BLOB Field ?


Quote
"Jeff Overcash (TeamB)" wrote:
> Please do not post in HTML.  Netscape showed your post as blank.

Sorry for offtopic, but Netscape must show that post correctly

Igor Zakhrebetkov

Re:how to Update JPEG to InterBase BLOB Field ?


It did not.  All I saw was a blank page as it did nto render the HTML
correctly.  Please don't come back and tell me I am lying.  His post (which
violates the rules of use for this newsgroups by being in HTML in the first
place) was entirely blank on my netscapes 4.76 on this machine.  I would never
have mentioned that it came up blank because of the HTML otherwise.

Quote
Igor Zakhrebetkov wrote:

> "Jeff Overcash (TeamB)" wrote:
> > Please do not post in HTML.  Netscape showed your post as blank.

> Sorry for offtopic, but Netscape must show that post correctly

> Igor Zakhrebetkov

--
Jeff Overcash (TeamB)
      (Please do not email me directly unless  asked. Thank You)
Anyone who cannot cope with mathematics is not fully human.
At best he is a tolerable subhuman who has learned to wear
shoes, bathe and not make messes in the house.   (Heinlein)

Re:how to Update JPEG to InterBase BLOB Field ?


Quote
"Jeff Overcash (TeamB)" wrote:
> place) was entirely blank on my netscapes 4.76 on this machine.  I would never
> have mentioned that it came up blank because of the HTML otherwise.

May be there is something wrong with your Win2000.
And your mailer shows netscape version 4.75.

Igor Zakhrebetkov

Re:how to Update JPEG to InterBase BLOB Field ?


"Jeff Overcash (TeamB)" <overc...@onramp.net> wrote in message
news:3AF41D3A.DA25781E@onramp.net...

Quote
> Please do not post in HTML.  Netscape showed your post as blank.

(Offtopic, but appropriate:)  I wish there was a way to have the news
server reject HTML posts, rather than have them go through and be
policed manually.

--
[ Kyle Cordes * k...@kylecordes.com * www.kylecordes.com ]
[ Training and Development Services: Java, Delphi, PHP,  ]
[ ASP, ASTA, Web Applications, n-tier systems, etc.      ]
[ Delphi developers: Visit the BDE Alternatives Guide    ]

Re:how to Update JPEG to InterBase BLOB Field ?


Quote
Kyle Cordes wrote:

> "Jeff Overcash (TeamB)" <overc...@onramp.net> wrote in message
> news:3AF41D3A.DA25781E@onramp.net...
> > Please do not post in HTML.  Netscape showed your post as blank.

> (Offtopic, but appropriate:)  I wish there was a way to have the news
> server reject HTML posts, rather than have them go through and be
> policed manually.

        Related matters are being investigated, so I'll suggest it.

        -Craig

--
Craig Stuntz (TeamB)       Senior Developer, Vertex Systems Corp.
Delphi/InterBase weblog:   http://delphi.weblogs.com
Use Borland servers; posts via others are not seen by TeamB.
For more info, see http://www.borland.com/newsgroups/genl_faqs.html

Re:how to Update JPEG to InterBase BLOB Field ?


Quote
Kyle Cordes wrote:

> (Offtopic, but appropriate:)  I wish there was a way to have the news
> server reject HTML posts, rather than have them go through and be
> policed manually.

As Craig said that is being investigated, but I know I'll vote against any mthod
that can't warn a user why their post was deleted.  Policing is definitely the
least enjoyable part of the job though.

--
Jeff Overcash (TeamB)
      (Please do not email me directly unless  asked. Thank You)
Anyone who cannot cope with mathematics is not fully human.
At best he is a tolerable subhuman who has learned to wear
shoes, bathe and not make messes in the house.   (Heinlein)

Other Threads