🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: cn.bbs.comp.program
1 messages
1 total messages Started by ��������� Fri, 12 Jun 1998 00:00
���delphi�е�API��������
#727
Author: ���������
Date: Fri, 12 Jun 1998 00:00
81 lines
2977 bytes
�����Լ�д�Ŀؼ�������windows��APIΪ�˼ӿ��ͼ�ٶȡ�����ֵ���
ÿ���½����̼����ҵĿؼ����ж����һ���˳�����open�������
�ͳ���out of system resources�Ĵ����Ҳ��ܴ��̣�����д�ļ���
��֪��ʲô�ط������⣬ԭ��������:
constructor TAIScrollimage.Create(Aowner:Tcomponent);
begin
   inherited Create(Aowner);
   Fbitmap:=Tbitmap.Create;
   bitmap:=Tbitmap.Create;
   CurrentLeft:=0;
   currentTop:=0;
   width:=40;
   height:=40;
end;
procedure TAIScrollimage.paint;
var ret:integer;
begin
   bitblt(canvas.handle,0,0,width,height,hdcCopy,Currentleft,CurrentTop,SRCCOPY);
end;

procedure TAIScrollimage.loaded;
begin
   HdcCopy:=CreateCompatibleDC(canvas.Handle);
   Hbitmapbackup:=selectobject(hdcCopy,Fbitmap.Handle);
end;
procedure TAIScrollimage.mousemove(Shift: TShiftState; X, Y: Integer);
begin
  if (0<y)and(y<FScrollRange) then
   begin
     if(currentTop-10>0) then begin CurrentTop:=currentTop-10;
        bitblt(canvas.handle,0,0,width,height,hdcCopy,Currentleft,CurrentTop,SRCCOPY);
     end
     else begin CurrentTop:=0;//invalidate;
     end;
     exit;
   end;
 if (0<x)and(x<FScrollRAnge) then
 begin
    if (currentLeft-10>0) then begin currentLeft:=CurrentLeft-10;
       bitblt(canvas.handle,0,0,width,height,hdcCopy,Currentleft,CurrentTop,SRCCOPY);
       end
    else begin CurrentLeft:=0;//invalidate;
    end;
    exit;
 end;
 if (width-x>0)and(width-x<FScrollRange) then
 begin
    if(currentLeft+width+10<Fbitmap.Width) then begin CurrentLeft:=CurrentLeft+10;
       bitblt(canvas.handle,0,0,width,height,hdcCopy,Currentleft,CurrentTop,SRCCOPY);
       end
    else begin Currentleft:=Fbitmap.width-width;//invalidate;
    end;
    exit;
 end;
 if(height-y>0)and(height-y<FScrollRange) then
 begin
   if(CurrentTop+height+10<Fbitmap.Height) then begin CurrentTop:=CurrentTop+10;
      bitblt(canvas.handle,0,0,width,height,hdcCopy,Currentleft,CurrentTop,SRCCOPY);
      end
   else begin CurrentTop:=Fbitmap.Height-height;//invalidate;
   end;
   exit;
 end;
end;

destructor TAIScrollimage.destroy;
var ret:integer;
    r:longbool;
begin

    ret:=selectobject(hdccopy,Hbitmapbackup);
//    ret:=releaseDc(handle,hdccopy);
    r:=deleteDc(hdccopy);
    Fbitmap.free;
//    bitmap.free;
    inherited destroy;
end;

--
�� ��Դ: �й�ƴ�BBSվ [bbs.ustc.edu.cn]
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads