Page 1 of 1
Hello i have a problem for TDBPicShow dbdemo help me pleas

Posted:
August 31st, 2003, 12:05 pm
by test111
sorry for my english im french do you speak french ????
please i have a problem for dbdemo TDBPicShow
the demo is conected for access database ans read picture in the database in my soft i have a patch for picture in my b ase please help me for change code
-----
bonjour j'ai un probleme avec le fichier de dbdemo du composant TDBPicShow
dans l'exemple vous aceder a une base accs dont le cham stoque l'image dans lmage dans la base
dans mon programme je ne stoque dans la base que le chemin d'acces aux images car je traite une tres grande quantité d'images pouriez vous m'indiquer les modif a faire pour que cela fonctionne
a titre indicatif j'utilise un table paradox merci d'avance

Posted:
August 31st, 2003, 2:24 pm
by Kambiz
You just need to replace TADOTable with a TTable, that's all.
hello sorry i have a problem for exemple

Posted:
August 31st, 2003, 10:43 pm
by test111
hello i have a problem this id and pic =Graphic table
in my soft i have a id and patchpicture = alpha table
in patchpicture i have ptach for images ex:
c:\35874\rep\coll\548752\toto1.jpg for id 1
c:\35874\rep\coll\54785\toto2.jpg for id 2
i not stock picture in table please hel me for modif

Posted:
September 1st, 2003, 9:06 am
by Kambiz
You have to use TPicShow instead of TDBPicShow.
- Code: Select all
if PicShow.Busy then PicShow.Stop;
PicShow.Picture.LoadFromFile(PathToPicField.Value);
PicShow.Execute;
Use the above code when record is changed.
Cheers,
Kambiz
thanks please ypu have a demo

Posted:
September 1st, 2003, 11:35 am
by test111
hello you have a demo for this modification

Posted:
September 1st, 2003, 3:53 pm
by Kambiz
I don't have the demo.
You just need to replace the TDBPicSHow control with TPicShow and write the above code inside the OnDataChange event of the DataSource.
Please try it.
modification demo

Posted:
September 1st, 2003, 4:20 pm
by test111
hello i have change source code for patch
procedure TMainForm.ShowNextImage;
begin
Timer.Enabled := False;
// if there is not any image in the list exit
if Pictures.Count = 0 then Exit;
// if PicShow is playing, stops it
if PicShow.Busy then
PicShow.Stop;
// Sets the animation style according to user sellection
if RandomStyle.Checked then
Style.Value := Random(High(TShowStyle))+1
else if TurnStyle.Checked then
if Style.Value < High(TShowStyle) then
Style.Value := Style.Value + 1
else
Style.Value := 1;
// Updates image name status
ShownImage := LoadedImage;
PicShow.Picture.LoadFromFile(table1.FieldByName('Photo_min1').Value);
RunningFilename.Update;
// Begins the animation
PicShow.Execute;
end;
and
// Selects randomly an image from the image list and loades it into PicShow
procedure TMainForm.LoadNextImage;
var
Index: Integer;
begin
LoadedImage := EmptyStr;
if Pictures.Count > 0 then
begin
repeat
Index := Random(Pictures.Count);
until (Pictures.Count <= 1) or (ShownImage <> Pictures[Index]);
LoadedImage := Pictures[Index];
PicShow.Picture.LoadFromFile(table1.FieldByName('Photo_min1').Value);
end;
NextFilename.Caption := 'Next: ' + (table1.FieldByName('Photo_min1').Value);
NextFilename.Update;
end;
i have a problem the patch for picture is ok
the id of the table not change
the picture not change and in the table not change id

Posted:
September 1st, 2003, 5:01 pm
by Kambiz
You should modify the DB Demo.
If you modify the DB Demo as I described in my last post, when the user changes the current record the PicShow's image changes to the cirrent record's image.
ok for modif and not have posibility DBPicShowBeforeLoadPict

Posted:
September 1st, 2003, 5:27 pm
by test111
in the tpicshow not have a posibility for increment style transition
procedure TMainForm.DBPicShowBeforeLoadPicture(Sender: TObject);
begin
// Sets the animation style according to the user selection
if RandomStyle.Checked then
Style.Value := Random(High(TShowStyle))+1
else if TurnStyle.Checked then
if Style.Value < High(TShowStyle) then
Style.Value := Style.Value + 1
else
Style.Value := 1;
// Clears background if it is required
if ClearOldImage.Checked then
begin
DBPicShow.Clear;
DBPicShow.Update;
end;
end;

Posted:
September 1st, 2003, 5:36 pm
by Kambiz
No, there is not such a feature.