I'm don't think that it's possible to do it this way, TJpegImage doesn't
have a bitmap property...
The only way I have found t owork with JPegs in the past is to first copy
them to a bitmap so that the ScanLine can be accessed...
function JpegToBitmap(AJpeg: TJpegImage): TBitmap;
Result := TBitmap.Create;
Hope this helps
GmPrintSuite Print & Print Preview Components
> I tried:
> I just want to read(Scan the image) and I do:
> myRow := (image1.Picture.Graphic as TJPEGImage).Bitmap.ScanLine[iRow];
> I get a complie error: "undeclared identifier: Bitmap". What is my error?
> > Use this:
> > (MyImage.Picture.Graphic as TJPEGImage).Bitmap;
> > If you just want to read the pixels of the image, that bitmap will do.
> > you want to modify the pixels using Scanline or other techniques you
> > copy that bitmap image to another TBitmap instance
> > (mybmp.Assign(jpg.Bitmap)). You can the modify the other TBitmap
> > The image bits will be shared between the two TBitmap objects until you
> > modify one of them, and then the modified object creates a copy of the
> > automatically.
> > -Danny
> > > Thanks this worked. With this picture in my TImage control is there a
> > to
> > > view it as or move it into an TBitmap type object? I need to use the
> > > "Scanline" function on the bitmap to do low level stuff on it.
> > > Thanks
> > > > I had the same problem and found this in the newsgroups. I put it
> > the
> > > > OnCreate of the main form
> > > > Image1.Picture.RegisterFileFormat('JPG','JPEG Bitmap',TJPEGIMAGE);
> > > > G
> > > > > I droped a TImage control into my form. I am trying to load it
> > > > > myImage.Picture.LoadFromFile('myPict.jpg');
> > > > > I get the exception which says jpg files are not valid. Yet if I
> > > > > through the property sheet, I can statically load a jpg file. I
> > to
> > > > > show a blank picture canvis and allow runtime selection of what
> > > > > into it. How Do I do this?
> > > > > Thanks
> > > > > Leon P.