"Opret en shell for hver event?"
Hej eksperter!Håber I kan hjælpe en fyr der er ny i faget! ;-) Fatter ikke hvad jeg skal gøre når der står at jeg skal oprette en "shell" for hver event... Hvad er en shell?? *s*
Stykket jeg har det fra:
Step 4, Add eventsTo ensure that the TWAIN menu's are disabled and enabled at the right moments, and to enable your application to receive the image transferred from the device, you need to add three events. Select the TmcmTWAIN component placed on the main form, and then select the Events page in the Object Inspector. Create a shell for each of the following events, and fill in the code listed below.
· OnImageReady, is fired when the device has transferred an image to the TmcmTWAIN component. Note that a Windows bitmap handle is returned as a parameter with this event.
· OnEnableMenus, this event is fired when the device is closed.
· OnDisableMenus, this event is fired when the device is activated.
procedure TForm1.mcmTWAIN1DisableMenus(Sender: TObject);
begin
Acquire1.Enabled := False;
Source1.Enabled := False;
end;
procedure TForm1.mcmTWAIN1EnableMenus(Sender: TObject);
begin
Acquire1.Enabled := True;
Source1.Enabled := True;
end;
procedure TForm1.mcmTWAIN1ImageReady(Sender: TObject; pBmp: Pointer; pBmpInfo: PBitmapInfo; hImage: Hbitmap; FileName: string);
begin
Image1.Picture.Bitmap.FreeImage;
with Image1.Picture
do begin
Bitmap.ReleaseHandle;
Bitmap.Handle := hImage;
end;
Repaint;
end;
