我有一个带漫画书布局的.bmp图片.目前我的代码是这样的.如果我右键单击并按住鼠标按钮,我可以在漫画书页面上的其中一个框架周围绘制一个选框类型框.当我释放按钮时,它将放大到该帧.但它的瞬间.我希望它有动画效果.
因此,而不是将PicRect的值设置为"结束值"
PicRect.Left
PicRect.right
PicRect.top
PicRect.bottom
Run Code Online (Sandbox Code Playgroud)
如下面的代码所示,我需要一种慢慢到达那里的方法,某种类型的while循环一次设置一些这些值,直到它达到"最终值"但是我不是100%肯定这个数学如何工作中.也没有任何我的while循环尝试做任何事情,但放大太远.这是程序.
procedure TZImage.MouseUp(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer);
var coef:Double;
t:integer;
begin
if FMouse=mNone then Exit;
if x>ShowRect.Right then x:=ShowRect.Right;
if y>ShowRect.Bottom then y:=ShowRect.Bottom;
if FMouse=mZoom then begin //calculate new PicRect
t:=startx;
startx:=Min(startx,x);
x:=Max(t,x);
t:=starty;
starty:=Min(starty,y);
y:=Max(t,y);
FMouse:=mNone;
MouseCapture:=False;
//enable the following if you want to zoom-out by dragging in the opposite direction}
{ if Startx>x then begin
DblClick;
Exit;
end;}
if Abs(x-startx)<5 then Exit;
if (x - startx < y - starty) …Run Code Online (Sandbox Code Playgroud) 我试图找出如何通过它搜索标签Caption:
for I := ComponentCount - 1 downto 0 do
begin
if Components[i] is TLabel then
if Components[i].Caption = mnNumber then
begin
Components[i].Left := Left;
Components[i].Top := Top + 8;
end;
end;
Run Code Online (Sandbox Code Playgroud)
我收到一个错误:Undeclared identifier: 'Caption'.
我该如何解决这个问题?
我一直在寻找一个如何制作游戏菜单的例子.例如,我想让应用程序打开菜单.从那里它将打开"玩游戏""显示积分""退出".
到目前为止我所看到的一切都是弹出菜单..
因此我寻找的答案是关于使用"状态",如暂停状态,游戏状态等等.但我无法弄清楚应该是这样的布局或应该如何使用..没有如何创建MenuState而无法找到一个示例任何地方
使用过剩和freeglew
我正在尝试手动安装JCL和jvcldelphi xe2.
我按照指示安装了JCL,似乎安装没有问题.现在我尝试加载JVCL包16,它打开delphi并开始加载libarys,当它到达Jedi代码库MPL1.1时,我开始得到如下错误
Error reading form frmJucolorProviderDesigner
-class tjvcontextprovider not found
Ingnore Cancel Ingnore all
Run Code Online (Sandbox Code Playgroud)
这不是唯一一个我会得到一些不好的帖子,如果它有帮助的话
Error reading form JvStandardActions
-tjvSendMailAction not found
-tjvwebaction not found
Error reading form jvCheckItemsEditor
-tjvCheckListBox not found
Error reading form JvControlActoinsDM
-tjvControlcollapseAction not found
-TjvControlexpandAction not found
-TjvControlExportAction not found
-tjvControlOptimizeColumnsAction not found
-TjvControlCustomizeColumnsAction not found
-TjvControlPrintAction not found
Error reading form jvSpeedBarEditorMain
-jvFormStorage not found
-AppRegistryStorage not found
Run Code Online (Sandbox Code Playgroud)
等......如果你需要,我可以加上休息.
但每个 - 都是自己的对话框,[忽略] [取消] [忽略全部]
现在,在我按下忽略50次后,它将最终加载项目,当我尝试为JVCl包构建所有项目时,它说找不到所需的包jcl.
在库路径我有
..jcl\source\common
..jcl\source\windows
..jcl\source\include …Run Code Online (Sandbox Code Playgroud) 我有4个号码
a,b,c,d : integers
Run Code Online (Sandbox Code Playgroud)
我需要在2-7之间分配一个随机数,但所有四个数字的总数必须为22
我怎样才能做到这一点?
对于此实例,是否使用dbExpress数据库比ADO连接和Access数据库更快/更好/更少编程?
我从来没有使用过dbExpress,在编写网站时,我曾经使用过的其他数据库都是MYSQL.谢谢
狭谷
我试图找到所有具有扩展名.cbr或.cbz的文件
如果我将我的面具设置为*.cb?
它找到*.cbproj文件.如何将掩码设置为仅查找.cbr和.cbz文件?
这是我正在使用的代码.
我有两个编辑框EDIT1是搜索的位置,EDIT2是我把我的面具放在哪里.用于显示找到内容的列表框和"搜索"按钮.
edit1 := c:\
edit2 := mask (*.cb?)
Run Code Online (Sandbox Code Playgroud)
空间
procedure TFAutoSearch.FileSearch(const PathName, FileName : string; const InDir : boolean);
var Rec : TSearchRec;
Path : string;
begin
Path := IncludeTrailingBackslash(PathName);
if FindFirst(Path + FileName, faAnyFile - faDirectory, Rec) = 0 then
try
repeat
ListBox1.Items.Add(Path + Rec.Name);
until FindNext(Rec) <> 0;
finally
FindClose(Rec);
end;
If not InDir then Exit;
if FindFirst(Path + '*.*', faDirectory, Rec) = 0 then
try
repeat
if ((Rec.Attr and faDirectory) <> 0) and …Run Code Online (Sandbox Code Playgroud) 我想要一个关键控制相机.TForm没有Onkeypress所以如何从键盘读取这个输入?
procedure TForm2.FormKeyPress(Sender: TObject; var Key: Char);
var
ok: boolean;
begin
ok := true;
case Key of
'a': camera1.Position.y:=camera1.Position.y+1;
'A': camera1.Position.y:=camera1.Position.y+1;
'd': camera1.Position.y:=camera1.Position.y-1;
'D': camera1.Position.y:=camera1.Position.y-1;
'w': camera1.Position.X:=camera1.Position.X-1;
'W': camera1.Position.X:=camera1.Position.X-1;
'x': camera1.Position.X:=camera1.Position.X+1;
'X': camera1.Position.X:=camera1.Position.X+1;
'q': camera1.RotationAngle.z := camera1.RotationAngle.z-1;
'Q': camera1.RotationAngle.z := camera1.RotationAngle.z-1;
'e': camera1.RotationAngle.z := camera1.RotationAngle.z+1;
'E': camera1.RotationAngle.z := camera1.RotationAngle.z+1;
'z': camera1.Position.z:=camera1.Position.z+1;
'Z': camera1.Position.z:=camera1.Position.z+1;
'c': camera1.Position.z:=camera1.Position.z-1;
'C': camera1.Position.z:=camera1.Position.z-1;
else
ok := false;
end; {case}
//if ok then
// Invalidate;
positionChange(camera1);
RotationAngleChange(camera1);
end;
Run Code Online (Sandbox Code Playgroud) 尝试将背景图像添加到TGraphicControl.
TCard(TGraphicControl)
Private
BitMap1:TBitMap; {Used to store a card image}
Public
procedure SetBitmap(image: TBitmap);
Run Code Online (Sandbox Code Playgroud)
......
procedure TCard.SetBitmap(image: TBitmap);
begin
bitmap1 := Tbitmap.create();
bitmap1.Assign(image);
canvas.draw(0,0,bitmap1);
end;
Run Code Online (Sandbox Code Playgroud)
在表单1按钮单击,我想将图像添加到tcard组件
procedure TForm1.Button1Click(Sender: TObject);
var
image : Tbitmap;
jpg: TJpegImage;
begin
image := TBitmap.create();
jpg := Tjpegimage.Create();
jpg.LoadFromFile(dir+'\pics\backcard.jpg');
image.Assign(jpg);
card1.setbitmap(image);
card1.Repaint;
image.Destroy;
jpg.Destroy;
end;
Run Code Online (Sandbox Code Playgroud)
当我跑步时,没有任何反应.如何将此图像添加到TCard组件的背景中?
好吧不确定这是正确的方式,甚至是正确的方式,但我已经看到了并开始使用它,假设您有6个文件
main.cpp
main.h
car.cpp
car.h
speed.cpp
speed.h
Run Code Online (Sandbox Code Playgroud)
delphi ×8
delphi-xe2 ×5
c++ ×2
ado ×1
dbexpress ×1
delphi-xe ×1
firemonkey ×1
freeglut ×1
glew ×1
header-files ×1
include ×1
jvcl ×1
mask ×1
opengl ×1