图片处理问题。急呀。。。 ( 积分: 50 )

  • 主题发起人 主题发起人 68686688
  • 开始时间 开始时间
6

68686688

Unregistered / Unconfirmed
GUEST, unregistred user!
我自己做写了一个按钮空间,但老是有错误。
经常会提示
Error reading MBTN15.Image.Date:Win32 Error、Code:87 参数错误
DRY Error reading bRIGHT Data: WIN32 Error.Code 87
不知道是为什么?请各位大虾帮我看一下,谢谢了。

constructor TmpBTN.Create( AOwner:TComponent );
begin
inherited Create( AOwner );
Width := 90;
Height := 49;
ControlStyle := ControlStyle + [csOpaque] ;
Font.Name := '宋体';
Font.Size := 10;
Font.Charset := GB2312_CHARSET;
Font.Style :=[];
Font.Color := ifCOLOR;
FSelection:=clBlue;
FBackground:= $00F7D8C1;
COLOR := FBackground;
FBitMap:=TBitmap.Create;

myBML:=TBitmap.Create;
myBMC:=TBitmap.Create;
myBMR:=TBitmap.Create;
APPLICATION.CreateForm( TmpBTNform1, mpBTNform1);
myBML.Assign( mpBTNform1.bLEFT.Picture.Bitmap);
myBMC.Assign( mpBTNform1.bCENTER.Picture.Bitmap);
myBMR.Assign( mpBTNform1.bRIGHT.Picture.Bitmap);
mpBTNform1.FREE;
end;

......

procedure TmpBTN.Paint;
const
PEN_WIDTH = 2;
Alignments: array[TAlignment] of Word = (DT_LEFT, DT_RIGHT, DT_CENTER);
WordWraps: array[Boolean] of Word = (0, DT_WORDBREAK);
var
Area,BitRect: TRect;
b : TBitmap;
L, R : INTEGER;
mB : BOOLEAN;
begin
b:=TBitmap.Create;
b.Width :=Width;

Height := myBML.Height;
b.Height:=Height;

L := myBML.Width;
B.Canvas.Draw( 0, 0, myBML);
R := B.Width-myBMR.Width;
B.Canvas.Draw( R, 0, myBMR);
WHILE L<R DO
BEGIN
B.Canvas.Draw( L, 0, myBMC);
L := L + myBMC.Width;
END;

TRY
mB := FBitMap.Empty;
IF NOT mB THEN
BEGIN
TRY
FBitMap.TransparentColor := CLWHITE;
FBitMap.Transparent := TRUE;
FINALLY
END;
R := (height-FBitMap.Height)DIV 2;
L := WIDTH-B.Canvas.TextWidth( CAPTION)-FBitMap.Width-10;
L := L DIV 2;
B.Canvas.Draw( L, R, FBitMap);
END;
EXCEPT
mB := TRUE;
END;

BitRect:= B.Canvas.ClipRect;
BitRect.Top := BitRect.Bottom-b.height;
BitRect.Right:=Width;
b.Canvas.CopyRect(b.Canvas.ClipRect,B.Canvas,BitRect);

Area:=b.Canvas.ClipRect;
Area.Left :=Area.Left;
Area.Right:=Area.Right;
b.canvas.Brush.Style := BsClear;
b.canvas.Font := Font;
IF NOT ENABLED THEN B.Canvas.Font.Color := dfCOLOR;

L := WIDTH-B.Canvas.TextWidth( CAPTION);
IF mB THEN L := L DIV 2 ELSE
BEGIN
TRY
L := WIDTH-B.Canvas.TextWidth( CAPTION)-FBitMap.Width-10;
L := L DIV 2;
L := L + FBitMap.Width + 10;
EXCEPT
END;
END;
R := (height-B.Canvas.TextHeight(CAPTION))DIV 2;
B.Canvas.TextOut( L, R, CAPTION);
IF lmBUTTON_Down THEN
BEGIN
Canvas.Draw( 1, 1, b);
END ELSE Canvas.Draw( 0, 0, b);
b.Free;
end;
 
请问一下68686688:delphi怎样调用DLL的PROCEDURE?谢谢!
 
Delphi的EXE和DLL之间最好不要传对象.除非你的EXE和DLL都是带运行时库方式编译.
PROCEDURE LIST_CLOTHES( APTEXT : PCHAR; CONST P:SMALLINT);STDCALL;
VAR
K : INTEGER;
S1 : STRING;
AP:TSTRINGS;
BEGIN
AP := TSTRINGLIST.CREATE;
AP.Text := APTEXT;
IF MULTISCR_CRT[P] THEN
WITH plyFORM[P] DO
BEGIN
S1 := TWOSCR_SEC + INTTOSTR( P);
S1 := READINI_INFOR( S1, 'SHOWCLOTHES', 'TRUE');
IF UPPERCASE( S1)='TRUE' THEN
BEGIN
plyFORM[P].ConList.Visible := TRUE;
FOR K:=0 TO SG1.RowCount-1 DO SG1.Cells[0,K] := '';
IF AP<>NIL THEN
FOR K:=0 TO AP.Count-1 DO SG1.Cells[0,K] := AP[K];
END;
END;
AP.Free;
END;

LIST_CLOTHES( PChar(MEMO1.Lines.Text), 1);
 
接受答案了.
 
后退
顶部