For The Neil

Are U online ?
LVL 9
ginsonicAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TheNeilCommented:
Gimme the points. Gimme the points. Gimme the points. Gimme...

The Neil
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ginsonicAuthor Commented:
I don't test yet the code ( I'm still to work ) .
How can I know if the picture is jpeg or bmp to know how I will do the slide ?

P.S. I'm on-line . U are ?
If U are on-line too , maybe we will comunicate faster .
0
TheNeilCommented:
Yeah I'm online and should be for about the next 4 hours.

You'll have to load the image in regardless of what format it is so what I'd do is this:

IF Pos('JPG', UpperCase(ExtractFileExt(sFilename)) <> 0
THEN
  LoadJPG(sFilename)
ELSE
  LoadBMP(sFilename);

Then just make sure that the LoadJPG and LoadBMP routines (which you'll have to write) load the image into the same TBitmap variable.

i.e. LoadJPG loads a JPG (using the code I gave you earlier) into a variable called bmpOrig_IMG and LoadBMP loads a BMP into the same variable

As per usual, anymore help needed just ask

The Neil
0
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

ginsonicAuthor Commented:
I make a component for this code ( see down of page ).
If I use bmps work perfect .
If use jpeg files I can see the image for PicFrom , but when I command Slide all images are gone
..
:(

........

TGNSlide = class(TGraphicControl)

private
    { Private declarations }
    FPicFrom:TPicture;
    FPicTo:TPicture;
    picT:TPicture;
    procedure PictureFrom(Pic:TPicture);
    procedure PictureTo(Pic:TPicture);

 public
    { Public declarations }
    procedure Slide;

 published
    { Published declarations }
    property PicFrom : TPicture read FPicFrom write PictureFrom;
    property PicTo : TPicture read FPicTo write PictureTo;

.........

procedure TGNSlide.Slide;
VAR
  bmpTemp : TPicture;
  n       : INTEGER;
  m       : INTEGER;

begin

  bmpTemp := TPicture.Create;
  bmpTemp.Assign(FPicTo);
  bmpTemp.Bitmap.Canvas.Draw(0, 0, FPicFrom.Bitmap);

  FOR n := 0 TO (PicTo.Width - 1)
  DO
  BEGIN
    FOR m := 0 TO (PicTo.Height - 1)
    DO
    bmpTemp.Bitmap.Canvas.Pixels[n, m] := PicTo.Bitmap.Canvas.Pixels[n, m];
    Canvas.Draw(0, 0, bmpTemp.Bitmap);
    Application.ProcessMessages;
  END;
  bmpTemp.Free;

end;
0
TheNeilCommented:
Hmmm. I'm not a big component expert so I'm not 100% certain as to why it doesn't want to work but I do have an idea. In your Slide routine, replace the TPicture with TBitmap. It could be something to do with the way the JPEG image is stored in the TPicture.

The Neil
0
ginsonicAuthor Commented:
It's work . Thanks .
i have a minir problem .
How can I refresh the PicFrom ?
How can I force the program to repaint the bitmap ?

Only if you can help me .
Thx again for help.
And hope to help me in future .
0
ginsonicAuthor Commented:
It's work . Thanks .
I have a minor problem .
How can I refresh the PicFrom ?
How can I force the program to repaint the bitmap ?

Only if you can help me .
Thx again for help.
And hope to help me in future .
0
ginsonicAuthor Commented:
Thanks again Neil .
0
TheNeilCommented:
Anytime Nick

The Neil
0
ginsonicAuthor Commented:
I fix my problem .
Just Refresh :)
See U,
Nick
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.