当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

 ·请看看我的代码什么地方有错    »显示摘要«
    摘要: private sub imagebutton1_click(byval sender as system.object, byval e as system.web.ui.imageclickeventargs) handles imagebutton1.click if textbox3.text <> textbox5.text then label1.text = ......
    摘要: 有谁知道pb6.5中的o73 oracle 7.3能连上oracle817吗? 怎么提示说用户名密码不正确,很正确啊? 用pb7或pb8的oracle8以上的驱动 连接都很正常的! 迷惑?? ......


关于FORM的背景图的问题

我有个图象是32×32的,想用它来做FORM的背景图  
  可是FORM太大,图象太小  
  如何使的该图象能以重慢整个FORM的背景哪?  
 

NO.1   作者: DJ_KK

帮你UP一下,我不会

NO.2   作者: galxh

是啊!我本来想问的,关于如何获取图像的高度与宽度,关注

NO.3   作者: cxreal

1、在Var部分加入以下说明:  
  TileImage:TImage;    
  2、编写Form1.OnCreate事件代码:  
  procedure   TForm1.FormCreate(Sender:   TObject);  
  begin  
  TileImage:=TImage.Create(Self);  
  TileImage.Picture.LoadFromFile(bg_green.bmp);  
  end;  
  3、编写Form1.OnPaint事件代码:  
  procedure   TForm1.FormPaint(Sender:   TObject);  
  var  
  PWidth,PHeight,X,Y:   Integer;  
  begin  
  PWidth   :=   TileImage.Picture.Bitmap.Width;  
  PHeight   :=   TileImage.Picture.Bitmap.Height;  
  X   :=   0;  
  while   X   <   Form1.Width   do   begin  
  Y   :=   0;  
  while   Y   <   Form1.Height   do   begin  
  Form1.Canvas.Draw(X,   Y,   TileImage.Picture.Bitmap);  
  Y   :=   Y   +   PHeight;  
  end;  
  X   :=   X   +   PWidth;  
  end;  
  end;

NO.4   作者: renzhm

你需要把主窗体设置为:formStyle:=fsMDIForm;  
   
  procedure   TMainFrm.DrawStretched;//拉伸  
  var  
      CR:   TRect;  
  begin  
      GetWindowRect(ClientHandle,   CR);  
      StretchBlt(FDrawDC,   0,   0,   CR.Right,   CR.Bottom,  
                            imgMain.Picture.Bitmap.Canvas.Handle,   0,   0,  
                            imgMain.Picture.Width,   imgMain.Picture.Height,   SRCCOPY);  
  end;  
   
  procedure   TMainFrm.DrawCentered;//局中  
  var  
      CR:   TRect;  
  begin  
      GetWindowRect(ClientHandle,   CR);  
      with   imgMain   do  
          BitBlt(FDrawDC,   ((CR.Right   -   CR.Left)   -   Picture.Width)   div   2,  
                                          ((CR.Bottom   -   CR.)   -   Picture.Height)   div   2,  
                                          Picture.Graphic.Width,   Picture.Graphic.Height,  
                                          Picture.Bitmap.Canvas.Handle,   0,   0,   SRCCOPY);  
  end;  
   
  procedure   TMainFrm.DrawTiled;//平铺  
  var  
      Row,   Col:   Integer;  
      CR,   IR:   TRect;  
      NumRows,   NumCols:   INteger;  
   
  begin  
      GetWindowRect(ClientHandle,   CR);  
      IR   :=   imgMain.ClientRect;  
      NumRows   :=   CR.Bottom   div   IR.Bottom;  
      NumCols   :=   CR.Right   div   IR.Right;  
      with   imgMain   do  
          for   Row   :=0   to   NumRows+1   do  
              for   Col   :=0   to   NumCols+1   do  
                  BitBlt(FDrawDC,   Col*Picture.Width,   Row*Picture.Height,  
                                                  Picture.Width,   Picture.Height,  
                                                  Picture.Bitmap.Canvas.Handle,   0,   0,   SRCCOPY);  
  end;  
   
  procedure   TMainFrm.ClientWndProc(var   Message:   TMessage);  
  begin  
      case   Message.Msg   of  
      WM_EraseBKGnd:  
          begin  
              CallWindowProc(FoldClientProc,   ClientHandle,   Message.Msg,  
                                            Message.WParam,   Message.LParam);  
              FDrawDC   :=   TWMEraseBKGnd(Message).DC;  
              DrawStretched;     //拉伸  
              //DrawCentered;       //居中  
              //DrawTiled;             //平铺  
              Message.Result   :=   1;  
          end;  
      WM_VSCROLL,   WM_HSCROLL:  
          begin  
              Message.Result   :=   CallWindowProc(FOldClientProc,   CLientHandle,  
                                                                      Message.Msg,   Message.WParam,   Message.LParam);  
              InvalidateRect(ClientHandle,   nil,   True);  
          end;  
      else  
          Message.Result   :=   CallWindowProc(FOldClientProc,   CLientHandle,  
                                                                      Message.Msg,   Message.WParam,   Message.LParam);  
      end;  
  end;  
   
  procedure   TMainFrm.FormCreate(Sender:   TObject);  
  begin  
      FNewClientProc   :=   MakeObjectInstance(ClientWndProc);  
      FOldClientProc   :=   Pointer(GetWindowLong(ClientHandle,   GWL_WNDPROC));  
      SetWindowLong(ClientHandle,GWL_WNDPROC,LongInt(FNewClientProc));  
  end;  
 

NO.5   作者: qwertyasd

var  
  pjpg:tjpegimage;  
  X,Y:INTEGER;  
  begin  
  X:=0;  
  Y:=0;  
  pjpg:=tjpegimage.Create;  
  pjpg.LoadFromFile(D:\1.jpg);  
   
  WHILE   Y<IMAGE1.Height     DO  
      BEGIN  
          WHILE   X<IMAGE1.Width   DO  
          BEGIN  
            IMAGE1.Canvas.Draw(X,Y,pjpg);  
            X:=X+pjpg.Width;  
          END;  
        X:=0;  
        Y:=Y+pjpg.Height;  
      END;  
  end;  
 


 ·两个简单的问题    »显示摘要«
    摘要: 向各位高手请教: 1、在vc中vector如何使用?我加了include <vector>也没用,编译时不认识vector。我程序中的语句是:vector <int> masksvector; 2、  int width,height; ......//各变量初始化 maskvalueelement *resultbuffer;    for(int i=0;i&......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE