大家请进,有三个小问题!!!!!(50分)

  • 主题发起人 主题发起人 flyapple
  • 开始时间 开始时间
F

flyapple

Unregistered / Unconfirmed
GUEST, unregistred user!
1. 问题-->>>在一本书中有如下一边文章:
"When you are playing back fairly large metafiles, you can sometimes see the shapes being painted to the screen one at a time. This helps to illustrate the fact that metafiles are literally just lists of GDI calls with their related parameters and device contexts carefully preserved. There are calls available that enable you to walk through these lists and delete or modify individual items"
问题也就来了,当我在TMetafileCanvas对象中画完了一个圆,一条线...后,
能否在程序后对已画完的对象再次修改????
2. 问题-->>>如何使设置的窗口系统按钮立即有效.
我希望在程序中动态的使得窗口系统按钮有效/无效,我采用的方法如下:
在ButtonClicked中,程序如下:
HMENU menu = GetSystemMenu(Handle,false);
DeleteMenu(menu,SC_CLOSE,MF_COMMAND);
虽然系统关闭按钮已无效了,可是窗口还是没有刷新,即系统关闭按钮外表看还是有效的,我只有手工移动/改变窗口,才让系统刷新.我用了几种方法都无效:
1.(Invalidate),2.(InvalidateRect),3.(SendMessage(Handle,WM_PAINT,
0,0)).....
3. 问题-->>>如何使用BorderIcons?
我希望动态的使得系统窗口按钮无效,用的如下代码,(copy from help)
开始时BorderIcons,使用的是系统缺省值.
BorderIcons = BorderIcons - (TBorderIcons()<< biMaximize);
但是程序执行完后,窗口所有的窗口按钮都没有了,why???




 
2. 给当前窗口发送WM_NCPAINT或者用RedrawWindow刷新
3.
Bordericons := Exclude(BorderIcons, biMaximize);
// 去掉maximize按钮
redrawwindow(handle, nil, 0, RDW_INVALIDATE or RDW_FRAME or RDW_UPDATENOW or RDW_ALLCHILDREN);

{ or: }
{ perform(WM_NCPAINT, 0, 0);
}
 
3.
var
icons: TBorderIcons;
icons := BorderIcons;
exclude(icons, biMaximize);
BorderIcons := icons;
......
 
1. 可以:
To edit a picture stored in an enhanced metafile, an application must
perform the following tasks.
1. Use hit-testing to capture the cursor coordinates and retrieve
the position of the object (line, arc, rectangle, ellipse, polygon, or irregular shape) that the user wants to alter.
2. Convert these coordinates to logical (or world) units.
3. Call the EnumEnhMetaFile function and examine each
metafile record.
4. Determine whether a given record corresponds to a GDI
drawing function.
5. If itdo
es, determine whether the coordinates stored
in the record correspond to the line, arc, ellipse, or other graphics
element that intersects the coordinates specified by the user.
6. Upon finding the record that corresponds to the output that
the user wants to alter, erase the object on the screen that
corresponds to the original record.
7. Delete the corresponding record from the metafile,
saving a pointer to its location.
8. Permit the user to redraw or replace the object.
9. Convert the GDI functions used to draw the new object
into one or more enhanced-metafile records.
10. Store these records in the enhanced metafile.
 
谢谢 Another_eYes:

问题三:已经搞定了!!
问题二:您所提的方法我也试过了,还是不行,why???
问题一:您能告诉我,the english help for the metafile come from?

Another_eYes 不好意思,分分我想开始定少了,再次谢谢您!!!!
 
试试 redrawwindow(Handle, nil, 0,
RDW_ERASE or RDW_INVALIDATE or RDW_FRAME or
RDW_ERASENOW or RDW_ALLCHILDREN);
 
win32.hlp in your delphi's help directory.
 
Another_eYes:
问题二:您所提的如下方法我也试过了,还是不行,why???
"
试试 redrawwindow(Handle, nil, 0,
RDW_ERASE or RDW_INVALIDATE or RDW_FRAME or
RDW_ERASENOW or RDW_ALLCHILDREN);"
问题一:我一查过win32.hlp in your delphi's help directory,讲得比较
泛,我也查过msdn->Metafile sample (GDI)->Click to open or copy the files for the Metafile sample.可能是我的msdn有问题,Sample中只有一个
makefile文件,如果您有的话,能否打包send to me.
fly_apple@263.net.
银子马上奉上.

 
1, 我没有
2. call DrawMenuBar(form.handle) after you change the menu.
 
1.画过的线是不能进行操作的,除非它是个对象,就象Word那样。
 
问题二:已经搞定了!!
谢谢 Another_eYes;
 
多人接受答案了。
 
后退
顶部