barriers / 阅读 / 详情

在VFP中,怎么样将一张DBF表转为EXCEL的XSL表?

2023-07-07 20:19:36
共1条回复
cloudcone
简单的,用Copy to EXCEL表名.xls type xl5,注意的是,运行此命令时须使要转换的DBF表在当前工作区,可以通过Select来择取工作区。

另外提供一些以编程方式将DBF导成XSL的程式及相关资料,希望对你有用:

VFP导成XLS&& DbfToExcel.PRG
&& 记得要安装Excel啊,否则不好用

CLOSE DATABASES ALL
SET DATE YMD
SET CENTURY ON
cDbfFile = GETFILE("dbf")
IF EMPTY(cDbfFile)
RETURN
ENDIF
USE (cDbfFile) ALIAS FoxTable IN 0
IF NOT USED("FoxTable")
=MESSAGEBOX("打开表失败,程序将中止!", 16, "Error")
RETURN
ENDIF
cExcelFile = PUTFILE("保存为(&N):",JUSTSTEM(cDbfFile)+".xls","xls")
IF EMPTY(cExcelFile)
CLOSE DATABASES ALL
RETURN
ENDIF
SELECT FoxTable
oExcelSheet = GETOBJECT("","Excel.Sheet") && 产生Excel对象
IF NOT TYPE("oExcelSheet") = "O"
=MESSAGEBOX("Excel对象创建失败,程序将中止!", 16, "Error")
RETURN
ENDIF
oExcelApp = oExcelSheet.Application
oExcelApp.Workbooks.Add()
oExcelApp.ActiveWindow.WindowState=2
oSheet = oExcelApp.ActiveSheet
nFldCount = AFIELDS(aFldList, "FoxTable")
FOR i = 1 TO nFldCount
oSheet.Cells(1,i).Value = aFldList[i, 1]
ENDFOR
cRecc = STR(RECCOUNT("FoxTable"))
SCAN
WAIT WINDOW ALLTRIM(STR(RECNO())) + "/" + cRecc NOWAIT
FOR i = 1 TO nFldCount
vValue = .NULL.
IF AT(aFldList[i, 2], "CDLMNFIBYT") = 0
LOOP
ENDIF
cFldName = aFldList[i, 1]
vValue = EVALUATE(cFldName)
DO CASE
CASE aFldList[i, 2] = "C" && 字符/字符串
vValue = TRIM(vValue)
CASE aFldList[i, 2] = "D" && 日期
vValue = DTOC(vValue)
CASE aFldList[i, 2] = "T" && 日期时间
vValue = TTOC(vValue)
CASE INLIST(aFldList[i, 2], "N", "F", "I", "B", "Y") && 数值
CASE aFldList[i, 2] = "L" && 逻辑
CASE aFldList[i, 2] = "M" && 备注型
OTHERWISE
vValue = .NULL.
ENDCASE
IF VARTYPE(vValue) = "C" AND EMPTY(vValue)
LOOP
ENDIF
IF NOT ISNULL(vValue)
oSheet.Cells(RECNO("FoxTable")+1, i).Value = vValue
ENDIF
ENDFOR
ENDSCAN
cChrStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
FOR i = 1 TO nFldCount
cColumn = SUBSTR(cChrStr, INT((i-1)/26), 1) + SUBSTR(cChrStr, IIF(MOD(i, 26)= 0, 26, MOD(i, 26)) , 1)
oSheet.Columns(cColumn + ":" + cColumn).ColumnWidth = 12
IF aFldList[i, 2] = "M"
oSheet.Columns(cColumn + ":" + cColumn).WrapText = .F.
ENDIF
ENDFOR
oExcelApp.ActiveWorkbook.SaveAs(cExcelFile)
oExcelApp.ActiveWorkbook.Close(.F.)
oExcelApp.ActiveWorkbook.Close(.F.)
oExcelApp.Quit
oExcelSheet = .NULL.
oExcelApp = .NULL.
WAIT CLEAR
=MESSAGEBOX("转换完毕!", 64, "OK")
CLOSE DATABASES ALL

程序是用VFP8写的,在VFP6中也可以,没有问题。只要能够执行完成,就会是正确的,行数只受你安装的Excel最大行数限制,至少大于65535行

这个程序支持所有字段类型,包括MEMO类型字段。

在VFP中全面控制Excel VFP和Excel都可以用来进行处理数据库表格,如果巧妙地将二者的优点结合起来,将会大大方便我们的工作。比如我们可以利用VFP进行处理数据,而利用Excel的预览打印功能进行报表打印。这就需要我们在VFP中直接来控制Excel。下面就在开发VFP应用项目时对Excel的控制作一下介绍:
1.创建Excel对象
eole=CREATEOBJECT(′Excel.application′)
2.添加新工作簿
eole.Workbooks.add
3.设置第3个工作表为激活工作表
eole.Worksheets(〃sheet3〃).Activate
4.打开指定工作簿
eole.Workbooks.Open(〃c: empll.xls〃)
5.显示Excel窗口
eole.visible=.t.
6.更改Excel标题栏
eole.Caption=〃VFP应用程序调用Microsoft Excel〃
7.给单元格赋值
eole.cells(1,4).value=XM(XM为数据库字段名)
8.设置指定列的宽度(单位:字符个数)
eole.ActiveSheet.Columns(1).ColumnWidth=5
9.设置指定行的高度(单位:磅)
eole.ActiveSheet.Rows(1).RowHeight=1/0.035
(设定行高为1厘米,1磅=0.035厘米)
10.在第18行之前插入分页符
eole.Worksheets(〃Sheet1〃).Rows(18).PageBreak=1
11.在第4列之前删除分页符
eole.ActiveSheet.Columns(4).PageBreak=0
12.指定边框线宽度(Borders参数如下)
ole.ActiveSheet.Range(〃b3:d3〃).Borders(2).Weight=3
13.设置四个边框线条的类型
eole.ActiveSheet.Range(〃b3:d3〃).Borders(2).LineStyle=1
(其中Borders参数:1-左、2-右、3-顶、4-底、5-斜、6-斜/;LineStyle值:1与7-细实、2-细虚、4-点虚、9-双细实线)
14.设置页眉
eole.ActiveSheet.PageSetup.CenterHeader=〃报表1〃
15.设置页脚
eole.ActiveSheet.PageSetup.CenterFooter=〃第&P页〃
16.设置页眉到顶端边距为2厘米
eole.ActiveSheet.PageSetup.HeaderMargin=2/0.035
17.设置页脚到底边距为3厘米
eole.ActiveSheet.PageSetup.FooterMargin=3/0.035
18.设置顶边距为2厘米
eole.ActiveSheet.PageSetup.TopMargin=2/0.035
19.设置底边距为4厘米
eole.ActiveSheet.PageSetup.BottomMargin=4/0.035
20.设置左边距为2厘米
veole.ActiveSheet.PageSetup.LeftMargin=2/0.035
21.设置右边距为2厘米
eole.ActiveSheet.PageSetup.RightMargin=2/0.035
22.设置页面水平居中
eole.ActiveSheet.PageSetup.CenterHorizontally=.t.
23.设置页面垂直居中
eole.ActiveSheet.PageSetup.CenterVertically=.t.
24.设置页面纸张大小(1-窄行8 5 11 39-宽行14 11)
eole.ActiveSheet.PageSetup.PaperSize=1
25.打印单元格网线
eole.ActiveSheet.PageSetup.PrintGridlines=.t.
26.拷贝整个工作表
eole.ActiveSheet.UsedRange.Copy
27.拷贝指定区域
eole.ActiveSheet.Range(〃A1:E2〃).Copy
28.粘贴
eole.WorkSheet(〃Sheet2〃).Range(〃A1〃).PasteSpecial
29.在第2行之前插入一行
eole.ActiveSheet.Rows(2).Insert
30.在第2列之前插入一列
eole.ActiveSheet.Columns(2).Insert
31.设置字体
eole.ActiveSheet.Cells(2,1).Font.Name=〃黑体〃
32.设置字体大小
eole.ActiveSheet.Cells(1,1).Font.Size=25
33.设置字体为斜体
eole.ActiveSheet.Cells(1,1).Font.Italic=.t.
34.设置整列字体为粗体
eole.ActiveSheet.Columns(1).Font.Bold=.t.
35.清除单元格公式
eole.ActiveSheet.Cells(1,4).ClearContents
36.打印预览工作表
eole.ActiveSheet.PrintPreview
37.打印输出工作表
eole.ActiveSheet.PrintOut
38.工作表另为
eole.ActiveWorkbook.SaveAs(〃c: emp22.xls〃)
39.放弃存盘
eole.ActiveWorkbook.saved=.t.
40.关闭工作簿
eole.Workbooks.close
41.退出Excel
eole.quit

以上控制调用语句在中文VFP5.0企业版下运行通过,运行环境为Excel 97及中文Windows 98。

Grid转Excel的类

*------------------------------------*
rex1105

************

*****转excel类,编写日期:2006-05-23 By Rex1105

********

PARAMETERS oGrid,cHeader
IF PARAMETERS()<2
Return .F.
ENDIF
cRec=ALLTRIM(oGrid.RECORDSOURCE)
Select ALIAS(cRec)
FILE_NAME=PUTFILE("","","XLS")
IF EMPTY(FILE_NAME)
Return .F.
ENDIF

***检查是否有安装office软件***
excelsheet=GETOBJECT("","excel.sheet")
IF TYPE("excelsheet")#"O"
MESSAGEBOX("您没有安装office办公软件!",16,"信息提示")
RELEASE excelsheet
Return .F.
ENDIF
****检查文件有无打开*****
LOCAL loldsetopt,mChanNum,nWS
nWs=2
loldsetopt=DDESETOPTION("safety")
=DDESETOPTION("safety",.F.)
mChanNum=DDEINITIATE("excel","&file_NAME")
IF <>mChanNum-1
MESSAGEBOX("有同名的Excel文件打开!请先关闭它!",64,"信息提示")
=DDETERMINATE(mChanNum)
=DDESETOPTION("safety",loldsetopt)
Return .F.
ELSE
=DDETERMINATE(mChanNum)
=DDESETOPTION("safety",loldsetopt)
ENDIF
LOCAL cCopy,oexl
DIMENSION [oGrid.ColumnCount,2]dColumn

FOR i=1 TO oGrid.COLUMNCOUNT
FOR ii=1 TO oGrid.COLUMNCOUNT
nOrder=oGrid.COLUMNS(ii).COLUMNORDER
IF nOrder=i
[i,1]dColumn=oGrid.COLUMNS(ii).header1.CAPTION
[i,2]dColumn=oGrid.COLUMNS(ii).CONTROLSOURCE
EXIT
ENDIF
ENDFOR
ENDFOR

****建立输出文件*****
cCopy=""
FOR i=1 TO ALEN(dColumn,1)
cCopy=cCopy+[i,2]dColumn+","
NEXT
cCopy=LEFT(cCopy,LEN(cCopy)-1)
cCopy="COPY TO "+"""+FILE_NAME+"""+" TYPE XL5 FIELDS "+cCopy
&cCopy

&&建立excel表,并写表头
oexl=CREATEOBJECT("excel.APPLICATION")
WITH oexl
.workbooks.OPEN(FILE_NAME)
.VISIBLE=.T.
.cells.Select
.Selection.FONT.Size=10
ENDWITH
Select ALIAS(cRec)
=AFIELDS(cField,cRec)
****第一行加中文标题*****
FOR i=1 TO ALEN(dColumn,1)
oexl.cells(1,i).VALUE=[i,1]dColumn
****每列数据处理,分字符与数值日期*****
DO CASE
CASE TYPE([i,2]dColumn)="N"
***查找数值的小数位****
FOR ii=1 TO ALEN(cField,1)
IF UPPER([i,2]dColumn)=UPPER(cRec)+"."+[ii,1]cField
nWS=[ii,4]cField
EXIT
ENDIF
NEXT
oexl.COLUMNS(retuabc(i)+":"+retuabc(i)).NumberFormatLocal = "#,##0."+REPLICATE("0",nWs)+"_);[红色](#,##0."+REPLICATE("0",nWs)+")"
CASE TYPE([i,2]dColumn)="D" OR TYPE([i,2]dColumn)="T"
oexl.COLUMNS(retuabc(i)+":"+retuabc(i)).NumberFormatLocal = "yyyy/mm/dd"
ENDCASE
NEXT

****表格线****

oexl.RANGE("A1:"+retuabc(ALEN(dColumn,1))+ALLTRIM(Str(RECCOUNT()+1))).Select

oexl.Selection.BorderS(5).LineStyle = -4142
oexl.Selection.BorderS(6).LineStyle = -4142
WITH oexl.Selection.BorderS(7)
.LineStyle =1
.Weight = 2
.ColorIndex = -4105
ENDWITH
WITH oexl.Selection.BorderS(8)
.LineStyle =1
.Weight = 2
.ColorIndex =-4105
ENDWITH
WITH oexl.Selection.BorderS(9)
.LineStyle =1
.Weight = 2
.ColorIndex = -4105
ENDWITH
WITH oexl.Selection.BorderS(10)
.LineStyle =1
.Weight = 2
.ColorIndex = -4105
ENDWITH
WITH oexl.Selection.BorderS(11)
.LineStyle =1
.Weight = 1
.ColorIndex = -4105
ENDWITH
WITH oexl.Selection.BorderS(12)
.LineStyle =1
.Weight = 1
.ColorIndex = -4105
ENDWITH

***第一行显示灰色加粗体****
WITH oexl.RANGE("A1:"+retuabc(ALEN(dColumn,1))+"1")
.HorizontalAlignment=3
.VerticalAlignment = 2
.WrapText = .T.
.FONT.bold=.T.
.Interior.ColorIndex = 40
ENDWITH

oexl.Rows("1:1").Select
oexl.Selection.INSERT
oexl.Selection.INSERT
oexl.Selection.INSERT
&&抬头
WITH oexl.RANGE("A1:"+retuabc(ALEN(dColumn,1))+"1")
.merge
.VALUE=cHeader
.FONT.Size=14
.HorizontalAlignment=3
.VerticalAlignment=2
.FONT.bold=.T.
ENDWITH
&&加报表时间
WITH oexl.RANGE("A2:d2")
.merge
.VALUE="报表时间:"+TTOC(DATETIME())
ENDWITH
&&加表格第一列
oexl.cells.Select
oexl.Selection.COLUMNS.AUTOFIT()
RELEASE oexl
Return .T.

相关推荐

c#操作word表格垂直居中

代码不懂,帮不到。
2023-07-07 10:48:524

matlab 请问如何可以把我在x轴上的标记垂直显示,比如VerticalAlignment 谢谢

%label each markerset(gca,"XTick",[4.75,9.5,12.5,19.0,25.0,37.5,50.8]);set(gca,"XTickLabel",{ }); pos=[4.75,9.5,12.5,19.0,25.0,37.5,50.8];h=text(pos,pos.*0-10,{"4.75","9.5","12.5","19.0","25","37.5","50.8"})set(h,"Rotation",90)
2023-07-07 10:49:021

如何使 TTTAttributedLabel 以编程方式在 IOS 中的居中对齐

默认属性attributedLabel.verticalAlignment=TTTAttributedLabelVerticalAlignmentCenter ;工作不同时应用链接...我想要基于它的长度,如下所示的居中对齐标签...如果是正常的 TTTAttribute 标签而不应用的链接,然后默认对齐属性正确应用...这里是我用于添加链接的代码...- (void)viewDidLoad { [super viewDidLoad]; NSRange matchRange; NSString *tweet = @"#MYTWEET ,#tweet, #fashion #Share"; NSScanner *scanner = [NSScanner scannerWithString:tweet]; if (,[scanner scanUpToString:@"#" intoString:nil]) { // there is no opening tag } NSString *result = nil; if (,[scanner scanUpToString:@" " intoString:&result]) { // there is no closing tag } //@"theString is:%@",result);NSArray *words = [tweet componentsSeparatedByString:@" "]; TTTAttributedLabel *attributedLabel=[[TTTAttributedLabel alloc]initWithFrame:CGRectMake(5, 200, 320, 40)]; attributedLabel.textAlignment=NSTextAlignmentCenter; attributedLabel.text=tweet; words = [tweet componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@",0123456789`~,@$%^&*()_-+=.></?;:"* "]]; for (NSString *word in words) { if ([word hasPrefix:@"#"]) { //@"word %@",word); // Colour your "word" here matchRange=[tweet rangeOfString:word]; [attributedLabel addLinkToURL:[NSURL URLWithString:word] withRange:matchRange]; [tagsarray addObject:word]; } } attributedLabel.delegate=self; } - (void)attributedLabel:(TTTAttributedLabel *)label didSelectLinkWithURL:(NSURL *)url { //@"result ==== %@",url); NSString *webString=[NSString stringWithFormat:@"%@",url]; NSString *tagstring = [webString stringByReplacingOccurrencesOfString:@"#" withString:@""]; NSLog(@"Tag String is:%@",tagstring); }我不想要调整大小的帧 TTTAttribute 标签...将赞赏的任何建议或帮助...先谢谢了...解决方法 1:它非常简单,使用下面的代码。
2023-07-07 10:49:092

请问什么是MVA?

MVA全称为(Multi-domain VerticalAlignment),是一种多象限垂直配向技术,属于VA型面板的其中一种。MVA是较早投入应用的广视角液晶面板,由日本富士通公司开发,目前生产MVA的厂家有奇美电子和友达光电等。它是利用突出物使液晶静止时并非传统的直立式,而是偏向某一个角度静止;当施加电压让液晶分子改变成水平以让背光通过则更为快速,这样便可以大幅度缩短显示时间,也因为突出物改变液晶20ms以内。分子配向,让视野角度更为宽广。在视角的增加上可达160度以上,反应时间短。
2023-07-07 10:49:173

C#WPF点击不同按钮下方如何显示不同的内容

可以用TabItem,也可以用用户控件实现,点击按钮下方切换显示不同页面,例:xmal:<Border BorderThickness="1" BorderBrush="#FF37474B" CornerRadius="3,3,0,0"> <DockPanel Height="40" VerticalAlignment="Top" Background="#FF37474B"> <!--style是我自己写的样式,你可以自己写--> <Button x:Name="paidan" Style="{StaticResource BtnStyle}" Content="按钮1" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5,10,0,0" Click="tcbi_order_Clicked"/> <Button x:Name="fahuo" Style="{StaticResource BtnStyle}" Content="按钮2" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5,10,0,0" Click="deliverGoods_order_Clicked"/> </DockPanel> </Border> <DockPanel Margin="0,40,0,0"> <!--这里面就是你要交换的页面显示--> <ContentControl Name="Change_Page"/> </DockPanel>后台: 按钮事件: Change_Page.Content = new Frame() { Content = new 页面名称() };
2023-07-07 10:49:242

WPF怎么修改在窗体里引用的UserControl中元素的值?

首先、要引用用户控件的命名控件 xmlns:my="clr-namespace:WpfApplicationDemo.Control"然后、把用户控件添加到窗体中<my:UserControl1 HorizontalAlignment="Left" Margin="38,46,0,0" x:Name="userControl11" VerticalAlignment="Top" Height="183" Width="215" />代码如下:<Window x:Class="WpfApplicationDemo.UserControlDemo"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:my="clr-namespace:WpfApplicationDemo.Control"Title="UserControlDemo" Height="300" Width="300" Loaded="Window_Loaded"><Grid><TextBlock Height="23" HorizontalAlignment="Left" Margin="10,10,0,0" Name="textBlock1" Text="下面是用户控件" VerticalAlignment="Top" /><StackPanel Height="175" HorizontalAlignment="Left" Margin="20,57,0,0" Name="stackPanel1" VerticalAlignment="Top" Width="246" /><my:UserControl1 HorizontalAlignment="Left" Margin="38,46,0,0" x:Name="userControl11" VerticalAlignment="Top" Height="183" Width="406" /></Grid></Window>
2023-07-07 10:49:311

Excel vba里怎么设置单元格的内容对齐方式

具体步骤如下:1、首先打开需要编辑的Excel表格,进入到编辑页面中。2、然后点击打开开发者工具中的“Visual Basic”。3、然后在弹出来的窗口中点击打开插入中的“模块”选项。4、然后在弹出来的窗口中点击输入下面的代码:Sub cell()Dim icell As Integer, hcell As IntegerFor icell = 4 To 35If UCase(Cells(icell, 1).Value) = "SAT" Or UCase(Cells(icell, 1).Value) = "SUN" ThenCells(icell, 1).Value = UCase(Cells(icell, 1).Value)For hcell = 1 To 21Cells(icell, hcell).Interior.Color = RGB(200, 200, 200)Cells(icell, 1).HorizontalAlignment = xlCenterCells(icell, 1).VerticalAlignment = xlCenterCells(icell, 1).Font.Bold = TrueNextEnd IfNextEnd Sub就可以了。
2023-07-07 10:49:412

什么是显示器最佳视角?

液晶显示屏的视角角度视角角度乃是评估LCD显示器的主要项目之一。虽然能够从各种角度观赏CRT显示器所呈现的影像,不过LCD显示器却必须从正前方观赏才能够获得最佳的视觉效果。如果从其它角度看,则画面的亮度会变暗(亮度减退)、颜色改变、甚至某些产品会由正像变为负像。 直到不久之前,采用无源矩阵式的旧型机种仍有上述问题。有源矩阵式TFTLCD显示器的这种现象就比较轻微。某些较新型的桌上型产品,尤其是17英寸以上的机种,采用in-plane交换技术来扩大画面的观赏角度。如此一来,效果最好的桌上型显示器,其观赏角度已经能够逼近CRT显示器,约为左右两侧各80度,也就是水平观赏角度为160度,几乎能够从任何角度看到画面的内容。一般地,140至160度的可视角度即成为大尺寸LCD显示器的基本指标。对于较小尺寸的15英寸或15英寸以下的LCD显示器,120度的可视角度便足以显示完整的画面。左右两侧的观赏角度一般会大于上下的观赏角度,也就是垂直的观赏角度小于水平观赏角度(一般介于120至140度之间)。尽管如此,越来越多的LCD显示器强调其水平与垂直观赏角度相同。在购买能够将画面由横式旋转为直式的产品之前,一定要先比较其水平与垂直的观赏角度是否相同。因为旋转前的垂直观赏角度,在旋转后就成为水平观赏角度了。有一点值得特别注意,各厂商测量观赏角度的方法不太相同,所以产品规格书上的数值仅供参考。某些厂商以画面中心点为基准,而有些则是分别以上下左右四个边缘的数值予以平均而得。更糟糕的是,目前对?quot;可观赏"的定义并不明确。某些厂商系以画面亮度减半为标准;也有厂商则是以画面的对比为标准,如15∶1、10∶1或5∶1。由于认定标准较为主观,所以光看规格说明书反而会被误导。VESA发表的测量观赏角度标准,目前尚未被所有厂商所全面采用。为今之计,只有在购买前尽可能实地参观比较。
2023-07-07 10:51:533

手机屏幕材质的区别

主要种类有:1、LCD液晶显示屏LCD(Liquid CrystalDisplay)的全称是液晶显示器,是现在用的比较多的手机屏幕材料,特点是价格便宜,使用普及广泛,在显示的时候需要有背光的支持。2、TFT屏TFT(Thin Film Transistor)即薄膜场效应晶体管,属于有源矩阵液晶显示器中的一种。TFT液晶显示屏的特点是亮度好、对比度高、层次感强、颜色鲜艳,但也存在着比较耗电和成本较高的不足。3、IPS屏IPS俗称“Super TFT”,是由TFT升级而来的一种技术,本质还是TFT屏幕,只不过是采用IPS技术的TFT屏。相对于普通的TFT屏,它拥有可视角度大、色彩还原准确、触摸无水纹、环保省电等优势。4、SLCD屏SLCD是拼接专用液晶屏,是LCD的一个高档进阶品种,特点是色彩更暖,还原真实,更自然,适合人眼观看。5、OLED屏OLED( OrganicLight-Emitting Diode)指有机发光二极管,OLED无需背光支持,具备自发光性,同时拥有广视角、高对比、低耗电、高反应速率以及全彩化、制程简单等优点。6、AMOLED屏AMOLED屏幕拥有可弯曲,广色域的特性,显示的颜色更加鲜艳,并且具有自发光低功耗等优点,已经成为主流高端手机热选。应用手机屏幕的智能手机在出厂前都需要经过测试,手机屏幕的质量和性能都至关重要,手机厂商对这一环节也相当重视,大电流弹片微针模组在智能手机屏幕测试中,起到连接导通的作用,可以有效解决手机屏幕测试问题。
2023-07-07 10:52:2310

求代码,C# 将数据和图片保存到Word

刚刚实现了个功能:用C#实现动态生成Word文档,在Word文档中插入表格,并将读出的数据填入到表格中。要使用C#操作word,首先要添加引用: 1、添加引用->COM->Microsoft Word 11.0 Object Library 2、在.cs文件中添加using Word;下面的例子中包括C#对Word文档的创建、插入表格、设置样式等操作:(例子中代码有些涉及数据信息部分被省略,重要是介绍一些C#操作word文档的方法) public string CreateWordFile(string CheckedInfo) ...{ string message = ""; try ...{ Object Nothing = System.Reflection.Missing.Value; Directory.CreateDirectory("C:/CNSI"); //创建文件所在目录 string name = "CNSI_" + DateTime.Now.ToShortString()+".doc"; object filename = "C://CNSI//" + name; //文件保存路径 //创建Word文档 Word.Application WordApp = new Word.ApplicationClass(); Word.Document WordDoc = WordApp.Documents.Add(ref Nothing, ref Nothing, ref Nothing, ref Nothing); //添加页眉 WordApp.ActiveWindow.View.Type = WdViewType.wdOutlineView; WordApp.ActiveWindow.View.SeekView = WdSeekView.wdSeekPrimaryHeader; WordApp.ActiveWindow.ActivePane.Selection.InsertAfter("[页眉内容]"); WordApp.Selection.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphRight;//设置右对齐 WordApp.ActiveWindow.View.SeekView = WdSeekView.wdSeekMainDocument;//跳出页眉设置 WordApp.Selection.ParagraphFormat.LineSpacing = 15f;//设置文档的行间距 //移动焦点并换行 object count = 14; object WdLine = Word.WdUnits.wdLine;//换一行; WordApp.Selection.MoveDown(ref WdLine, ref count, ref Nothing);//移动焦点 WordApp.Selection.TypeParagraph();//插入段落 //文档中创建表格 Word.Table newTable = WordDoc.Tables.Add(WordApp.Selection.Range, 12, 3, ref Nothing, ref Nothing); //设置表格样式 newTable.Borders.OutsideLineStyle = Word.WdLineStyle.wdLineStyleThickThinLargeGap; newTable.Borders.InsideLineStyle = Word.WdLineStyle.wdLineStyleSingle; newTable.Columns[1].Width = 100f; newTable.Columns[2].Width = 220f; newTable.Columns[3].Width = 105f; //填充表格内容 newTable.Cell(1, 1).Range.Text = "产品详细信息表"; newTable.Cell(1, 1).Range.Bold = 2;//设置单元格中字体为粗体 //合并单元格 newTable.Cell(1, 1).Merge(newTable.Cell(1, 3)); WordApp.Selection.Cells.VerticalAlignment = Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter;//垂直居中 WordApp.Selection.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter;//水平居中 //填充表格内容 newTable.Cell(2, 1).Range.Text = "产品基本信息"; newTable.Cell(2, 1).Range.Font.Color = Word.WdColor.wdColorDarkBlue;//设置单元格内字体颜色 //合并单元格 newTable.Cell(2, 1).Merge(newTable.Cell(2, 3)); WordApp.Selection.Cells.VerticalAlignment = Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter; //填充表格内容 newTable.Cell(3, 1).Range.Text = "品牌名称:"; newTable.Cell(3, 2).Range.Text = BrandName; //纵向合并单元格 newTable.Cell(3, 3).Select();//选中一行 object moveUnit = Word.WdUnits.wdLine; object moveCount = 5; object moveExtend = Word.WdMovementType.wdExtend; WordApp.Selection.MoveDown(ref moveUnit, ref moveCount, ref moveExtend); WordApp.Selection.Cells.Merge(); //插入图片 string FileName = Picture;//图片所在路径 object LinkToFile = false; object SaveWithDocument = true; object Anchor = WordDoc.Application.Selection.Range; WordDoc.Application.ActiveDocument.InlineShapes.AddPicture(FileName, ref LinkToFile, ref SaveWithDocument, ref Anchor); WordDoc.Application.ActiveDocument.InlineShapes[1].Width = 100f;//图片宽度 WordDoc.Application.ActiveDocument.InlineShapes[1].Height = 100f;//图片高度 //将图片设置为四周环绕型 Word.Shape s = WordDoc.Application.ActiveDocument.InlineShapes[1].ConvertToShape(); s.WrapFormat.Type = Word.WdWrapType.wdWrapSquare; newTable.Cell(12, 1).Range.Text = "产品特殊属性"; newTable.Cell(12, 1).Merge(newTable.Cell(12, 3)); //在表格中增加行 WordDoc.Content.Tables[1].Rows.Add(ref Nothing); WordDoc.Paragraphs.Last.Range.Text = "文档创建时间:" + DateTime.Now.ToString();//“落款” WordDoc.Paragraphs.Last.Alignment = Word.WdParagraphAlignment.wdAlignParagraphRight; //文件保存 WordDoc.SaveAs(ref filename, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing); WordDoc.Close(ref Nothing, ref Nothing, ref Nothing); WordApp.Quit(ref Nothing, ref Nothing, ref Nothing); message=name+"文档生成成功,以保存到C:CNSI下"; } catch ...{ message = "文件导出异常!"; } return message; }希望这些东西对你会有所帮助
2023-07-07 10:53:331

excel表格复制粘贴到CAD 字体重叠是怎么回事

可以使用EXCEL表格导入CAD里的软件,很好的,我有
2023-07-07 10:53:435

excel 单元格合并 循环执行命令

请参照如下,以理解代码为上,录制的太罗嗦了。那么长的一段无用的代码。Sub aa()For i = 1 To 110Range(Cells(i, 1), Cells(i, 3)).MergeNext iEnd Sub
2023-07-07 10:53:592

如何使用NSString在 drawInRect中居中

1. 纵你必须做你自己(的观点+字符串)/ 2的高度(高度)。卧式您可以这样做: NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; [style setAlignment:NSCenterTextAlignment]; NSDictionary *attr = [NSDictionary dictionaryWithObject:style forKey:NSParagraphStyleAttributeName]; [myString drawInRect:someRect withAttributes:attr]; 2. 这适用于水平 [textX drawInRect:theRect withFont:font lineBreakMode:UILineBreakModeClip alignment:UITextAlignmentCenter]; 3. 马丁斯答案是相当接近的,但它有一些小错误。试试这个: NSMutableParagraphStyle* style = [[NSMutableParagraphStyle alloc] init]; [style setAlignment:NSCenterTextAlignment]; NSDictionary *attr = [NSDictionary dictionaryWithObject:style forKey:NSParagraphStyleAttributeName]; [myString drawInRect:someRect withAttributes:attr]; [style release]; 你必须创建一个新的NSMutableParagraphStyle(而不是默认的段落样式马丁建议)[NSMutableParagraphStyle defaultParagraphStyle]返回NSParagraphStyle,它不具有另外,你不需要在字符串@"NSParagraphStyleAttributeName"-刚NSParagraphStyleAttributeName。 4. 此作品 CGRect viewRect = CGRectMake(x, y, w, h); UIFont* font = [UIFont systemFontOfSize:15]; CGSize size = [nsText sizeWithFont:font constrainedToSize:viewRect.size lineBreakMode:(UILineBreakModeWordWrap)]; float x_pos = (viewRect.size.width - size.width) / 2; float y_pos = (viewRect.size.height - size.height) /2; [someText drawAtPoint:CGPointMake(viewRect.origin.x + x_pos, viewRect.origin.y + y_pos) withFont:font]; 5. 正确的答案是:-drawInRect:withFont:lineBreakMode:alignment:我还创建了一个小类别垂直如果你喜欢它,继续前进:) // NSString+NSVerticalAlign.h typedef enum { NSVerticalTextAlignmentTop, NSVerticalTextAlignmentMiddle, NSVerticalTextAlignmentBottom } NSVerticalTextAlignment; @interface NSString (VerticalAlign) - (CGSize)drawInRect:(CGRect)rect withFont:(UIFont *)font verticalAlignment:(NSVerticalTextAlignment)vAlign; - (CGSize)drawInRect:(CGRect)rect withFont:(UIFont *)font lineBreakMode:(NSLineBreakMode)lineBreakMode verticalAlignment:(NSVerticalTextAlignment)vAlign; - (CGSize)drawInRect:(CGRect)rect withFont:(UIFont *)font lineBreakMode:(NSLineBreakMode)lineBreakMode alignment:(NSTextAlignment)alignment verticalAlignment:(NSVerticalTextAlignment)vAlign; @end // NSString+NSVerticalAlign.m #import "NSString+NSVerticalAlign.h" @implementation NSString (VerticalAlign) - (CGSize)drawInRect:(CGRect)rect withFont:(UIFont *)font verticalAlignment:(NSVerticalTextAlignment)vAlign { switch (vAlign) { case NSVerticalTextAlignmentTop: break; case NSVerticalTextAlignmentMiddle: rect.origin.y = rect.origin.y + ((rect.size.height - font.pointSize) / 2); break; case NSVerticalTextAlignmentBottom: rect.origin.y = rect.origin.y + rect.size.height - font.pointSize; break; } return [self drawInRect:rect withFont:font]; } - (CGSize)drawInRect:(CGRect)rect withFont:(UIFont *)font lineBreakMode:(NSLineBreakMode)lineBreakMode verticalAlignment:(NSVerticalTextAlignment)vAlign { switch (vAlign) { case NSVerticalTextAlignmentTop: break; case NSVerticalTextAlignmentMiddle: rect.origin.y = rect.origin.y + ((rect.size.height - font.pointSize) / 2); break; case NSVerticalTextAlignmentBottom: rect.origin.y = rect.origin.y + rect.size.height - font.pointSize; break; } return [self drawInRect:rect withFont:font lineBreakMode:lineBreakMode]; } - (CGSize)drawInRect:(CGRect)rect withFont:(UIFont *)font lineBreakMode:(NSLineBreakMode)lineBreakMode alignment:(NSTextAlignment)alignment verticalAlignment:(NSVerticalTextAlignment)vAlign { switch (vAlign) { case NSVerticalTextAlignmentTop: break; case NSVerticalTextAlignmentMiddle: rect.origin.y = rect.origin.y + ((rect.size.height - font.pointSize) / 2); break; case NSVerticalTextAlignmentBottom: rect.origin.y = rect.origin.y + rect.size.height - font.pointSize; break; } return [self drawInRect:rect withFont:font lineBreakMode:lineBreakMode alignment:alignment]; } @end 6. 嗯,drawInRect是唯一的好基本的文本绘制(换句话说,系统决定在何处放置您的文字)-常画你想要的文字定位是简单地计算出你想要它什么指向的NSString的drawAtPoint的唯一途径:withAttributes :。 此外,的NSString的sizeWithAttributes是你最终不得不做drawAtPoint任何定位的数学。 祝你好运! 7. [NSMutableParagraphStyle defaultParagraphStyle]不会[NSMutableParagraphStyle new]同时,它只会出现水平适用于drawInRect,不drawAtPoint(我怎么知道:-) 8. 下面的代码段用于绘制文本居中的注释自定义图像作为参考: CustomAnnotation.h @interface CustomAnnotation : MKAnnotationView [...] CustomAnnotation.m [...] - (void)drawRect:(CGRect)rect { ClusterAnnotation *associatedAnnotation = (CustomAnnotation *)self.annotation; if (associatedAnnotation != nil) { CGContextRef context = UIGraphicsGetCurrentContext(); NSString *imageName = @"custom_image.png"; CGRect contextRect = CGRectMake(0, 0, 42.0, 42.0); CGFloat fontSize = 14.0; [[UIImage imageNamed:imageName] drawInRect:contextRect]; NSInteger myIntegerValue = [associatedAnnotation.dataObject.myIntegerValue integerValue]; NSString *myStringText = [NSString stringWithFormat:@"%d", myIntegerValue]; UIFont *font = [UIFont fontWithName:@"Helvetica-Bold" size:fontSize]; CGSize fontWidth = [myStringText sizeWithFont:font]; CGFloat yOffset = (contextRect.size.height - fontWidth.height) / 2.0; CGFloat xOffset = (contextRect.size.width - fontWidth.width) / 2.0; CGPoint textPoint = CGPointMake(contextRect.origin.x + xOffset, contextRect.origin.y + yOffset); CGContextSetTextDrawingMode(context, kCGTextStroke); CGContextSetLineWidth(context, fontSize/10); CGContextSetStrokeColorWithColor(context, [[UIColor whiteColor] CGColor]); [myStringText drawAtPoint:textPoint withFont:font]; CGContextSetTextDrawingMode(context, kCGTextFill); CGContextSetFillColorWithColor(context, [[UIColor blackColor] CGColor]); [myStringText drawAtPoint:textPoint withFont:font]; } }
2023-07-07 10:54:061

java代码怎么导出excel文件

excel工具类package com.ohd.ie.product.action;import java.awt.image.BufferedImage;import java.io.*;import javax.imageio.ImageIO;import org.apache.commons.io.output.ByteArrayOutputStream;import jxl.Workbook;import jxl.format.Alignment;import jxl.format.VerticalAlignment;import jxl.write.*;import jxl.write.Number;import jxl.write.biff.RowsExceededException;public class Excel {private OutputStream os;private WritableWorkbook wwb = null;private WritableSheet ws = null;private WritableCellFormat titleCellFormat = null;private WritableCellFormat noBorderCellFormat = null;private WritableCellFormat hasBorderCellFormat = null;private WritableCellFormat hasBorderCellNumberFormat = null;private WritableCellFormat hasBorderCellNumberFormat2 = null;private WritableImage writableImage=null;private int r;public Excel(OutputStream os){this.os = os;r = -1;try {wwb = Workbook.createWorkbook(os);//创建工作表ws = wwb.createSheet("sheet1",0);//设置表头字体,大小,加粗titleCellFormat = new WritableCellFormat();titleCellFormat.setAlignment(Alignment.CENTRE);titleCellFormat.setVerticalAlignment(VerticalAlignment.CENTRE);//自动换行titleCellFormat.setWrap(true);titleCellFormat.setFont(new WritableFont(WritableFont.createFont("宋体"),12,WritableFont.BOLD));titleCellFormat.setBorder(jxl.format.Border.ALL, jxl.format.BorderLineStyle.THIN);//设置表格字体,大小----无边框noBorderCellFormat = new WritableCellFormat();noBorderCellFormat.setAlignment(Alignment.CENTRE);noBorderCellFormat.setVerticalAlignment(VerticalAlignment.CENTRE);noBorderCellFormat.setFont(new WritableFont(WritableFont.createFont("宋体"),12));//设置表格字体,大小----有边框hasBorderCellFormat = new WritableCellFormat();hasBorderCellFormat.setAlignment(Alignment.CENTRE);hasBorderCellFormat.setVerticalAlignment(VerticalAlignment.CENTRE);hasBorderCellFormat.setFont(new WritableFont(WritableFont.createFont("宋体"),12));hasBorderCellFormat.setBorder(jxl.format.Border.ALL, jxl.format.BorderLineStyle.THIN);//设置表格字体,大小----有边框(小数)NumberFormat nf = new NumberFormat("#0.00");hasBorderCellNumberFormat = new WritableCellFormat(nf);hasBorderCellNumberFormat.setAlignment(Alignment.CENTRE);hasBorderCellNumberFormat.setVerticalAlignment(VerticalAlignment.CENTRE);hasBorderCellNumberFormat.setFont(new WritableFont(WritableFont.createFont("宋体"),12));hasBorderCellNumberFormat.setBorder(jxl.format.Border.ALL, jxl.format.BorderLineStyle.THIN);//设置表格字体,大小----有边框(整数)NumberFormat nf2 = new NumberFormat("#0");hasBorderCellNumberFormat2 = new WritableCellFormat(nf2);hasBorderCellNumberFormat2.setAlignment(Alignment.CENTRE);hasBorderCellNumberFormat2.setVerticalAlignment(VerticalAlignment.CENTRE);hasBorderCellNumberFormat2.setFont(new WritableFont(WritableFont.createFont("宋体"),12));hasBorderCellNumberFormat2.setBorder(jxl.format.Border.ALL, jxl.format.BorderLineStyle.THIN);} catch (Exception e) {// TODO Auto-generated catch blocke.printStackTrace();}}/**** @param content 内容* @param c 列* @param style 样式* @param isNewLine 是否换行* @param mergeType 合并类型* @param mergeCount 合并个数* @param width 单元格宽*/public void setExcelCell(String content,int c,int style,boolean isNewLine,int mergeType,int mergeCount,int width){try {////////////////////////////////////////////////////////////////////////////////////////////////////////////////////报表内容////////////////////////////////////////////////////////////////////////////////////////////////////////////////////if(isNewLine){r++;}WritableCell l = null;if(style == 1){l = new Label(c,r,content,titleCellFormat);}else if(style == 2){l = new Label(c,r,content,noBorderCellFormat);}else if(style == 3){l = new Label(c,r,content,hasBorderCellFormat);}else if(style == 4){l = new Number(c,r,Double.parseDouble(content),hasBorderCellNumberFormat);}else if(style == 5){l = new Number(c,r,Integer.parseInt(content),hasBorderCellNumberFormat2);}ws.addCell(l);if(width != 0){ws.setColumnView(c,width);}//veryhuo,comif(mergeType == 1){//x 轴方向ws.mergeCells(c, r, c+mergeCount-1 , r);}else if(mergeType == 2){//y 轴方向ws.mergeCells(c, r, c, r+mergeCount-1);}if(isNewLine){ws.setRowView(r, 350);if(style == 1 && r != 0){ws.setRowView(r, 900);}else{ws.setRowView(r, 350);}}//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////} catch (Exception e) {System.out.println(e.toString());}}public void setExcelCellEx(String content,int c,int style,boolean isNewLine,int mergeType,int mergeCount,int width,int row){try {////////////////////////////////////////////////////////////////////////////////////////////////////////////////////报表内容////////////////////////////////////////////////////////////////////////////////////////////////////////////////////if(isNewLine){r++;}WritableCell l = null;if(style == 1){l = new Label(c,r,content,titleCellFormat);}else if(style == 2){l = new Label(c,r,content,noBorderCellFormat);}else if(style == 3){if(content.indexOf(".jpg")!=-1 ||content.indexOf(".JPG")!=-1){File outputFile=null;File imgFile =new File(content);if(imgFile.exists()&&imgFile.length()>0){BufferedImage input=null;try {input = ImageIO.read(imgFile);} catch (Exception e) {e.printStackTrace();}if(input!=null){String path=imgFile.getAbsolutePath();outputFile = new File(path.substring(0,path.lastIndexOf(".")+1)+"png");ImageIO.write(input, "PNG", outputFile);if(outputFile.exists()&&outputFile.length()>0){ws.setRowView(row,2000);//ws.setColumnView(8, 10);writableImage = new WritableImage(c+0.1, row+0.1, 0.8, 0.8, outputFile);ws.addImage(writableImage);l = new Label(c,r,"",hasBorderCellFormat);}}}}else{l = new Label(c,r,content,hasBorderCellFormat);}}else if(style == 4){l = new Number(c,r,Double.parseDouble(content),hasBorderCellNumberFormat);}else if(style == 5){l = new Number(c,r,Integer.parseInt(content),hasBorderCellNumberFormat2);}ws.addCell(l);if(width != 0){ws.setColumnView(c,width);}if(mergeType == 1){//x 轴方向ws.mergeCells(c, r, c+mergeCount-1 , r);}else if(mergeType == 2){//y 轴方向ws.mergeCells(c, r, c, r+mergeCount-1);}if(isNewLine){ws.setRowView(r, 350);if(style == 1 && r != 0){ws.setRowView(r, 900);}else{ws.setRowView(r, 350);}}} catch (Exception e) {System.out.println(e.toString());}}public void setRowHeight(int val){try {ws.setRowView(r, val);} catch (RowsExceededException e) {e.printStackTrace();}}public void getExcelResult(){try {wwb.write();} catch (Exception e) {System.out.println(e.toString());}finally{if(wwb != null){try {wwb.close();if(os != null){os.close();}} catch (WriteException e) {e.printStackTrace();} catch (IOException e) {e.printStackTrace();}}}}}需要的jar包:jxl.jar
2023-07-07 10:54:161

浩辰cad表格怎么导到excel

浩辰的扩展工具中有一个CAD转EXCEL的功能,在浩辰CAD8里命令名是GC_CTE
2023-07-07 10:54:395

wpf 做一个好看的标题栏?

blend 画啊
2023-07-07 10:55:274

wpf窗体当把他最大化时里面的控件也要调整位置的大小怎么做

<Button Content="提交修改" Height="23" HorizontalAlignment="Left" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click" />如果说你要button跟随最大化调整,就不要把Height Width 属性写死,写成百分比。或者说写他距离容器控件的相对位置,比如说距离左边框距离多少。
2023-07-07 10:55:531

苹果用的是什么屏幕?怎么样?

虽然官方iPhone换屏的价格比较高,但是比起在外面维修点的质量和工艺还是有很大优势的。而且在苹果授权服务网点给iPhone换屏是直接更换屏幕总成,不是外面维修点更换一个玻璃,所以在维修之后更加安全稳定。建议到正规的售后维修中心进行手机检测维修,正规的维修中心更换的屏幕质量保证,详细情况请点击头像
2023-07-07 10:56:156

这是一个用宏合并单元格的问题,执行完后达到了预期目的,但是执行完却会弹出溢出提示,坐等高手来解答

找给你写这个的人
2023-07-07 10:56:372

excel自动行高不合适怎么办

多选 行 或者列,拖动至合适位置,这样看起来,整体效果会好些。
2023-07-07 10:57:003

wpf如何设置 textbox文本垂直居中对齐

1.合理设置它的高度。2.设置它的Templete
2023-07-07 10:57:432

c# int不包含text定义

你那两个控件不是明明叫sd1和sd2么,改成int i=r.Next(int.Parse(sd1.Text),int.Parse(sd2.Text));另外,那个while(true)没什么意义,最好想清楚。
2023-07-07 10:57:501

LED的显示方式有哪几种?

  LED显示屏分为以下三种:  1、单基色显示屏:单一颜色。  2、双基色显示屏:红和绿双基色,256级灰度、可以显示65536种颜色。  3、全彩色显示屏:红、绿、蓝三基色,256级灰度的全彩色显示屏可以显示一千六百多万种颜色。  LED显示屏(LEDdisplay):一种平板显示器,由一个个小的LED模块面板组成。  LED,发光二极管(lightemittingdiode缩写)。它是一种通过控制半导体发光二极管的显示方式,由镓(Ga)与砷(As)、磷(P)、氮(N)、铟(In)的化合物制成的二极管,当电子与空穴复合时能辐射出可见光,因而可以用来制成发光二极管。在电路及仪器中作为指示灯,或者组成文字或数字显示。磷砷化镓二极管发红光,磷化镓二极管发绿光,碳化硅二极管发黄光,铟镓氮二极管发蓝光。
2023-07-07 10:58:002

如何向Word中写入数据,C#.net

那个一般是导入的
2023-07-07 10:58:087

vertical bar是什么意思

vertical bar n. 竖线(|);竖条
2023-07-07 10:58:273

Matlab怎样在图上显示指定点的坐标

对巳知坐标的点,可以这样标出:plot(5,38.45,"rs","MarkerEdgeColor","k","MarkerFaceColor","g","MarkerSize",5)text(5,38.45,"(5,38.45)","EdgeColor","red","VerticalAlignment","bottom");plot(38,126.36,"rs","MarkerEdgeColor","k","MarkerFaceColor","g","MarkerSize",5)text(38,126.36,"(38,126.36)","EdgeColor","red","VerticalAlignment","bottom");对未知坐标的点,可以先插值,再标出:以下代码在7.1版以上均可运行。close allclear,clcx=[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39];y2=[0 3.75 10.95 19.95 29.3 38.45 46.85 54.50 61.55 68.00 73.85 78.95 83.75 88.25 92.3 95.9 99.2 102.2 104.9 107.3 109.55 111.65 113.6 115.4 117.05 118.55 119.9 121.1 122.15 123.05 123.8 124.4 124.85 125.25 125.61 125.91 126.11 126.26 126.36 126.44];plot(x,y2);hold on;y3=126.44;plot(x,y3,"-");% Set up fittype and options.ft = "linearinterp";opts = fitoptions( ft );opts.Normalize = "on";% Fit model to data.fitresult = fit( x", y2", ft, opts );xx1 = [6.321,11.15,21.15]; % x = [6.321,11.15,21.15]yy1 = fitresult( xx1 ); % 与x对应的y值% 画点 标注for i = 1:length(xx1)plot(xx1(i),yy1(i),"rs","MarkerEdgeColor","k","MarkerFaceColor","g","MarkerSize",6)text(xx1(i),yy1(i),["(",num2str(xx1(i),"%5.2f"),",",num2str(yy1(i),"%5.2f"),")"],"EdgeColor","red","BackgroundColor",[.7 .9 .7],"VerticalAlignment","bottom");end
2023-07-07 10:58:511

EXCEL 直接复制到CAD里面,excel表格变成了空白表格,excel是2016 CAD是2014,2008的CAD也是这样,

用VBA可以将excel表格读取后画入CAD,这样可以解决。代码如下:(注:该代码要复制到CAD的文件中,当然在CAD中要加载EXCEL应用)Sub 根据excel自动画表() Dim xlApp As Excel.Application Set xlApp = GetObject(, "Excel.Application") Dim xlSheet As Worksheet Set xlSheet = xlApp.ActiveSheet Dim iPt(0 To 2) As Double iPt(0) = 0: iPt(1) = 0: iPt(2) = 0 Dim BlockObj As AcadBlock Set BlockObj = ThisDrawing.Blocks("*Model_Space") Dim xlRange As Range For Each xlRange In xlSheet.UsedRange AddLine BlockObj, xlRange AddText BlockObj, xlRange Next Set xlRange = Nothing Set xlSheet = Nothing Set xlApp = NothingEnd Sub"边框处理Sub AddLine(ByRef BlockObj As AcadBlock, ByVal xlRange As Range) Dim rl As Double Dim rt As Double Dim rw As Double Dim rh As Double rl = xlRange.Left / 2.835 rt = xlRange.top / 2.835 rw = xlRange.Width / 2.835 rh = xlRange.Height / 2.835 Dim pPt(0 To 3) As Double Dim pLineObj As AcadLWPolyline If xlRange.Borders(xlEdgeLeft).LineStyle <> xlNone And xlRange.Column = 1 Then pPt(0) = rl: pPt(1) = -rt pPt(2) = rl: pPt(3) = -(rl + rh) Set pLineObj = BlockObj.AddLightWeightPolyline(pPt) With xlRange.Borders(xlEdgeLeft) If .ColorIndex <> xlAutomatic Then If .ColorIndex = 3 Then pLineObj.color = acRed ElseIf .ColorIndex = 4 Then pLineObj.color = acGreen ElseIf .ColorIndex = 5 Then pLineObj.color = acBlue ElseIf .ColorIndex = 6 Then pLineObj.color = acYellow ElseIf .ColorIndex = 8 Then pLineObj.color = acCyan ElseIf .ColorIndex = 9 Then pLineObj.color = acMagenta End If End If If .Weight = xlThin Then pLineObj.ConstantWidth = 0 ElseIf .Weight = xlMedium Then pLineObj.ConstantWidth = 0.35 ElseIf .Weight = xlThick Then pLineObj.ConstantWidth = 0.7 End If End With End If If xlRange.Borders(xlEdgeBottom).LineStyle <> xlNone And (xlRange.Row = xlRange.MergeArea.Row + xlRange.MergeArea.Rows.Count - 1) Then pPt(0) = rl: pPt(1) = -(rt + rh) pPt(2) = rl + rw: pPt(3) = -(rt + rh) Set pLineObj = BlockObj.AddLightWeightPolyline(pPt) With xlRange.Borders(xlEdgeBottom) If .ColorIndex <> xlAutomatic Then If .ColorIndex = 3 Then pLineObj.color = acRed ElseIf .ColorIndex = 4 Then pLineObj.color = acGreen ElseIf .ColorIndex = 5 Then pLineObj.color = acBlue ElseIf .ColorIndex = 6 Then pLineObj.color = acYellow ElseIf .ColorIndex = 8 Then pLineObj.color = acCyan ElseIf .ColorIndex = 9 Then pLineObj.color = acMagenta End If End If If .Weight = xlThin Then pLineObj.ConstantWidth = 0 ElseIf .Weight = xlMedium Then pLineObj.ConstantWidth = 0.35 ElseIf .Weight = xlThick Then pLineObj.ConstantWidth = 0.7 End If End With End If If xlRange.Borders(xlEdgeRight).LineStyle <> xlNone And (xlRange.Column >= xlRange.MergeArea.Column + xlRange.MergeArea.Columns.Count - 1) Then pPt(0) = rl + rw: pPt(1) = -(rt + rh) pPt(2) = rl + rw: pPt(3) = -rt Set pLineObj = BlockObj.AddLightWeightPolyline(pPt) With xlRange.Borders(xlEdgeRight) If .ColorIndex <> xlAutomatic Then If .ColorIndex = 3 Then pLineObj.color = acRed ElseIf .ColorIndex = 4 Then pLineObj.color = acGreen ElseIf .ColorIndex = 5 Then pLineObj.color = acBlue ElseIf .ColorIndex = 6 Then pLineObj.color = acYellow ElseIf .ColorIndex = 8 Then pLineObj.color = acCyan ElseIf .ColorIndex = 9 Then pLineObj.color = acMagenta End If End If If .Weight = xlThin Then pLineObj.ConstantWidth = 0 ElseIf .Weight = xlMedium Then pLineObj.ConstantWidth = 0.35 ElseIf .Weight = xlThick Then pLineObj.ConstantWidth = 0.7 End If End With End If If xlRange.Borders(xlEdgeTop).LineStyle <> xlNone And xlRange.top = 1 Then pPt(0) = rl + rw: pPt(1) = -rt pPt(2) = rl: pPt(3) = -rt Set pLineObj = BlockObj.AddLightWeightPolyline(pPt) With xlRange.Borders(xlEdgeTop) If .ColorIndex <> xlAutomatic Then If .ColorIndex = 3 Then pLineObj.color = acRed ElseIf .ColorIndex = 4 Then pLineObj.color = acGreen ElseIf .ColorIndex = 5 Then pLineObj.color = acBlue ElseIf .ColorIndex = 6 Then pLineObj.color = acYellow ElseIf .ColorIndex = 8 Then pLineObj.color = acCyan ElseIf .ColorIndex = 9 Then pLineObj.color = acMagenta End If End If If .Weight = xlThin Then pLineObj.ConstantWidth = 0 ElseIf .Weight = xlMedium Then pLineObj.ConstantWidth = 0.35 ElseIf .Weight = xlThick Then pLineObj.ConstantWidth = 0.7 End If End With End If Set pLineObj = NothingEnd Sub"文字处理Sub AddText(ByRef BlockObj As AcadBlock, ByVal xlRange As Range) If xlRange.Text = "" Then Exit Sub Dim rl As Double Dim rt As Double Dim rw As Double Dim rh As Double rl = xlRange.Left / 2.835 rt = xlRange.top / 2.835 rw = xlRange.MergeArea.Width / 2.835 rh = xlRange.MergeArea.Height / 2.835 Dim iPt(0 To 2) As Double iPt(0) = rl: iPt(1) = -rt: iPt(2) = 0 Dim mTextObj As AcadMText Set mTextObj = BlockObj.AddMText(iPt, rw, xlRange.Text) Dim tPt As Variant If xlRange.VerticalAlignment = xlTop And (xlRange.HorizontalAlignment = xlLeft Or xlRange.HorizontalAlignment = xlGeneral) Then mTextObj.AttachmentPoint = acAttachmentPointTopLeft mTextObj.InsertionPoint = iPt ElseIf xlRange.VerticalAlignment = xlTop And xlRange.HorizontalAlignment = xlCenter Then mTextObj.AttachmentPoint = acAttachmentPointTopCenter tPt = ThisDrawing.Utility.PolarPoint(iPt, 0, rw / 2) ElseIf xlRange.VerticalAlignment = xlTop And xlRange.HorizontalAlignment = xlRight Then mTextObj.AttachmentPoint = acAttachmentPointTopRight tPt = ThisDrawing.Utility.PolarPoint(iPt, 0, rw) ElseIf xlRange.VerticalAlignment = xlCenter And (xlRange.HorizontalAlignment = xlLeft _ Or xlRange.HorizontalAlignment = xlGeneral) Then mTextObj.AttachmentPoint = acAttachmentPointMiddleLeft tPt = ThisDrawing.Utility.PolarPoint(iPt, -1.5707963, rh / 2) ElseIf xlRange.VerticalAlignment = xlCenter And xlRange.HorizontalAlignment = xlCenter Then mTextObj.AttachmentPoint = acAttachmentPointMiddleCenter tPt = ThisDrawing.Utility.PolarPoint(iPt, -1.5707963, rh / 2) tPt = ThisDrawing.Utility.PolarPoint(tPt, 0, rw / 2) ElseIf xlRange.VerticalAlignment = xlCenter And xlRange.HorizontalAlignment = xlRight Then mTextObj.AttachmentPoint = acAttachmentPointMiddleRight tPt = ThisDrawing.Utility.PolarPoint(iPt, -1.5707963, rh / 2) tPt = ThisDrawing.Utility.PolarPoint(tPt, 0, rw / 2) ElseIf xlRange.VerticalAlignment = xlBottom And (xlRange.HorizontalAlignment = xlLeft _ Or xlRange.HorizontalAlignment = xlGeneral) Then mTextObj.AttachmentPoint = acAttachmentPointBottomLeft tPt = ThisDrawing.Utility.PolarPoint(iPt, -1.5707963, rh) ElseIf xlRange.VerticalAlignment = xlBottom And xlRange.HorizontalAlignment = xlCenter Then mTextObj.AttachmentPoint = acAttachmentPointBottomCenter tPt = ThisDrawing.Utility.PolarPoint(iPt, -1.5707963, rh) tPt = ThisDrawing.Utility.PolarPoint(tPt, 0, rw / 2) ElseIf xlRange.VerticalAlignment = xlBottom And xlRange.HorizontalAlignment = xlRight Then mTextObj.AttachmentPoint = acAttachmentPointBottomRight tPt = ThisDrawing.Utility.PolarPoint(iPt, -1.5707963, rh) tPt = ThisDrawing.Utility.PolarPoint(tPt, 0, rw) End If mTextObj.InsertionPoint = tPt Set mTextObj = NothingEnd Sub
2023-07-07 10:59:001

外星人屏幕用的是WVA是什么意思

应该是MVA技术。它是一种显示技术。MVA技术(Multi-domainVerticalAlignment,多象限垂直配向技术)可以说是最早出现的广视角液晶面板技术。该类面板可以提供更大的可视角度,通常可达到170°。MVA是较早投入应用的广视角液晶面板,由日本富士通公司开发,目前生产MVA的厂家有奇美电子和友达光电等。它是利用突出物使液晶静止时并非传统的直立式,而是偏向某一个角度静止;当施加电压让液晶分子改变成水平以让背光通过则更为快速,这样便可以大幅度缩短显示时间,也因为突出物改变液晶20ms以内。分子配向,让视野角度更为宽广。在视角的增加上可达160度以上,反应时间短。
2023-07-07 10:59:091

c#对WORD的操作问题

直接复制不就好了咩?网页的,可以用OFS里面的网页功能的工具文字排版可以用WORD。看着弄、
2023-07-07 10:59:173

c# word输出问题?

看一下这个吧。我看着还不错,能看懂。。。http://blog.csdn.net/hx_xiaoyi/archive/2010/01/10/5169598.aspx
2023-07-07 10:59:262

C# WPF Image 显示居中显示图像 应该怎样设置呢?

设置Image的 HorizontalAlignment="Center" VerticalAlignment="Center"
2023-07-07 10:59:461

matlab :两个三角波分别从A、B两点相向而行,相遇后产生叠加,以动画表示。

x=-10:.025:10;for t=-7:.05:7 plot(x,(x+1+t).*(-1<x+t&x+t<=0)+(-x+1-t).*(0<x+t&x+t<1)+(x+1-t).*(-1<x-t&x-t<=0)+(-x+1+t).*(0<x-t&x-t<1),[-7 7],[0 0],"r."); text([-7 7],[0 0],{"A","B"},"HorizontalAlignment","center","VerticalAlignment","top","fontunits","normalized","fontsize",.1); axis([-10,10,-1,3]); drawnowend
2023-07-07 10:59:541

wpf 控件属性通过数据绑定到某个集合的某一个数据上。

<Label Content="{Binding Path=Array[2],ElementName="root"}"/>
2023-07-07 11:00:054

液晶显示屏,硬屏和软屏的区别是什么?

想必大家都听过液晶显示屏又分为硬屏和软屏,但是并不了解硬屏和软屏的区别,小编觉得是时候给大家科普一下硬屏和软屏的区别究竟是什么!硬屏和软屏的区别硬屏和软屏的区别一、硬盘优缺点。IPS技术(In-PlaneSwitching,平面转换)是日立公司于2001推出的液晶屏技术,俗称“SuperTFT”。此技术最大的特点是它的两极都在同一个面上,而不像其它液晶模式的电极是在上下两面,立体排列。由于电极在同一平面上,不管在何种状态下液晶分子始终都与屏幕平行,会使开口率降低,减少透光率,因此IPS应用在液晶电视上会需要更多的灯管,而在一定程度上,耗电量也会大些。另一个缺点是漏光问题比较严重,黑色纯度不够,对比要比PVA稍差,因此必须依靠光学膜的补偿才能实现更好的黑色。IPS屏的优点是可视角度高、向应速度快,色彩还原准确。和其它类型的屏相比,IPS屏的屏幕较为“硬”,用手轻轻划一下不容易出现水纹样变形,因此又有硬屏之称。硬屏和软屏的区别二、软屏优缺点富士通的MVA技术(Multi-domainVerticalAlignment,多象限垂直配向技术)可以说是最早出现的广视角液晶屏技术。该类屏可以提供更大的可视角度,通常可达到170°。改良后的P-MVA类屏可视角度可达178°,已接近目前消费者在家中观看的需求,向应时间亦可达到8ms以下。三星Samsung电子的PVA技术(PatternedVerticalAlignment)同样属于VA技术的范畴,它是MVA技术的继承者和发展者,改良型的S-PVA已经可以和P-MVA并驾齐驱。PVA采用透明的ITO电极代替MVA中的液晶层凸起物,透明电极可以获得更好的开口率,最大限度减少背光源的浪费。VA广视角技术,由于其强大的产能和稳定的质量控制体系,广泛应用于中高端液晶显示器或者液晶电视中。VA类屏属于软屏,用手轻轻划会出现类似的水纹。硬屏和软屏的区别三、结构所谓硬屏产品,就是在液晶屏面上加了一层硬度较高的透明树脂材料保护外膜的产品。硬屏工艺最初由日立等日系厂商所推广,后来LG将该技术进行了大幅的改良,从而形成了非常有特色的S-IPS硬屏工艺技术。硬屏的突出特点是屏幕具有一定的稳定性,用手指轻轻摁下去,不会出现明显的暗影,有利于屏幕保护,但粘贴工艺必须足够好。硬屏主要代表厂商是LG-飞利浦,LG、东芝、日立等厂商的液晶电视大多采用硬屏。这种硬屏液晶电视采用了一种叫做IPS的硬屏技术,由于拥有稳固的液晶分子排列结构,不仅可以完全消除液晶显示屏在受到外界压力时出现的模糊及水纹扩散现象,而且画质更加细腻,可视角度几乎达到180度,在显示动态画面时,对色彩稳定性和层次感的提升也大大提高,而且能保证图像显示的清晰度,更加适合观看比赛节目等动态画面。据了解,在科技含量较高的专业领域如航天、医疗、设计、传播等行业,都会使用色彩还原性更好的硬屏液晶。而且在北京地铁5号线等公共场所也采用了更可靠的硬屏液晶,毕竟,软屏液晶轻轻一碰就出现水纹的屏幕,实在让人觉得缺乏安全感。目前,像LG、松下、飞利浦、创维等许多品牌都早已把这种硬屏配备在主流产品上了。除了屏幕安全系数上的提升之外,硬屏作为液晶技术的革新,相比于传统软屏液晶的优势也绝不仅限于此。首先,硬屏液晶电视具有非常好的可视角度。与软屏液晶相比,由于硬屏通过独有的液晶分子水平转换技术,基本上解决了多年以来传统液晶电视在可视角度方面的痼疾。其次,与传统液晶电视相比,硬屏响应速度更快,呈现的运动画面也更为流畅。而传统的软屏会因为“运动模糊效应”发生大规模图像失真现象以及颜色变化。再者,硬屏液晶电视具有非常高的对比度,纯黑层次更清晰。硬屏液晶在各个灰阶中的白平衡变化完全可以忽略不计。通俗一点说,硬屏液晶电视所显示的画面比软屏的层次感更为清晰,画面表现更为生动。所谓的软屏是相对硬屏而言的,也就是没有采用保护外膜材料的液晶面板。TN、PVA、MVA等面板属于软屏,主要代表厂商是三星。这类液晶屏突出的特点是用手指轻摁或用指甲轻划下去,会出现较为明显的水波纹现象,但过一会儿就消失了。也许是三星S-LCD一类的液晶屏幕容易被摁出“水波纹”的缘故吧,因此称之为“软屏”。不要看重软硬之分。通过上文,大家可以发现硬屏和软屏的根本区别只在屏面加膜或不加膜,而加膜或不加膜不会也不可能改变液晶面板自身的内在物理性能。
2023-07-07 11:00:391

WPF中如何在文本外面加虚线外框

首先来个框:<Grid<BorderHorizontalAlignment="Center"VerticalAlignment="Center"Width="60"Height="30"CornerRadius="5" 第一个想到的就是修改Border的Brush,来看看这样的xaml:<Grid<BorderHorizontalAlignment="Center"VerticalAlignment="Center"Width="60"Height="30"CornerRadius="5" BorderThickness="3"<Border.BorderBrush<LinearGradientBrush SpreadMethod="Repeat"StartPoint="0,5"EndPoint="5,0"MappingMode ="Absolute"<LinearGradientBrush.GradientStops<GradientStopColor="Blue"Offset="0"/<GradientStopColor="Blue"Offset="0.2"/<GradientStopColor="Transparent"Offset="0.4"/<GradientStopColor="Transparent"Offset="0.6"/<GradientStopColor="Blue"Offset="0.8"/<GradientStopColor="Blue"Offset="1"/</LinearGradientBrush.GradientStops</LinearGradientBrush</Border.BorderBrush<TextBlockText="aaa"HorizontalAlignment="Center"VerticalAlignment="Center"/</Border</Grid 看看效果图: 再换个思路,更换为使用DrawingBrush:<Grid<BorderHorizontalAlignment="Center"VerticalAlignment="Center"Width="60"Height="30"CornerRadius="5" BorderThickness="3"<Border.BorderBrush<DrawingBrush<DrawingBrush.Drawing<GeometryDrawing<GeometryDrawing.Pen<PenBrush="Blue"Thickness="3"<Pen.DashStyle<DashStyleDashes="3,2,0,2"/</Pen.DashStyle</Pen</GeometryDrawing.Pen<GeometryDrawing.Geometry<RectangleGeometryRect="0,0,60,30"RadiusX="3"RadiusY="3"/</GeometryDrawing.Geometry</GeometryDrawing</DrawingBrush.Drawing</DrawingBrush</Border.BorderBrush<TextBlockText="aaa"HorizontalAlignment="Center"VerticalAlignment="Center"/</Border</Grid 看看效果图: 利用Pen的DashStyle可以轻易的实现点划的虚线图,当然也可以轻易实现点点划的虚线,DashStyle的规则为:实线长度,空线长度,实线长度,空线长度u2026,而实现长度如果为0,就代表点。 不过细看这张图的话,还是会发现一些不和谐的东西,圆角从外侧看,确实是圆的,但是仔细看内侧的话,发现其内侧竟然是个直角。。。 好吧,换个思路,放弃Border了,直接用Canvas,加Rectange:<Grid<GridHorizontalAlignment="Center"VerticalAlignment="Center"Width="60"Height="30"<Canvas<RectangleRadiusX="5"RadiusY="5"Width="60"Height="30"Stroke="Blue"StrokeDashArray="5,2,1,2"StrokeThickness="2"/</Canvas<TextBlockText="aaa"HorizontalAlignment="Center"VerticalAlignment="Center"/</Grid</Grid 看看效果图: 看起来还不错,确实是圆角的,不过这后面两个方案也有个明显的缺点,就是无法随着文本框内容的增长而动态的绘制。当然可以用Binding来进一步消除这个问题:<Grid<GridHorizontalAlignment="Center"VerticalAlignment="Center"Width="60"Height="30"x:Name="g"<Canvas<RectangleRadiusX="5"RadiusY="5"Width="{BindingElementName=g, Path=Width}"Height="{BindingElementName=g, Path=Height}"Stroke="Blue"StrokeDashArray="5,2,1,2"StrokeThickness="2"/</Canvas<TextBlockText="aaa"HorizontalAlignment="Center"VerticalAlignment="Center"/</Grid</Grid效果图: 看起来还不错,不过这个方案还是存在问题的,如果容器Grid本身是自增长的,那么杯具就开始了:<Grid<GridHorizontalAlignment="Center"VerticalAlignment="Center"x:Name="g"<Canvas<RectangleRadiusX="5"RadiusY="5"Width="{BindingElementName=g, Path=Width}"Height="{BindingElementName=g, Path=Height}"Stroke="Blue"StrokeDashArray="5,2,1,2"StrokeThickness="2"/</Canvas<TextBlockText="aaa"HorizontalAlignment="Center"VerticalAlignment="Center"/</Grid</Grid效果图:可以发现,Grid使用了自增长的方式,Binding也只能获得错误的Width和Height,也就是0,不过别担心,WPF还提供了ActualWidth和ActualHeight:<Grid<GridHorizontalAlignment="Center"VerticalAlignment="Center"x:Name="g"<Canvas<RectangleRadiusX="5"RadiusY="5"Width="{BindingElementName=g, Path=ActualHeight}"Stroke="Blue"StrokeDashArray="5,2,1,2"StrokeThickness="2"/</Canvas<TextBlockMargin="10,7,10,7"Text="aaa"HorizontalAlignment="Center"VerticalAlignment="Center"/</Grid</Grid效果图:哈哈,圆满达成目标。
2023-07-07 11:00:471

为什么我用EXCEL做了一个合并单元格的宏执行不了?

安全级别设置为“中”,在打开文件时选择启用宏。PS:如果设为低,会给不明来源的宏病毒可乘之机。
2023-07-07 11:00:582

WPF 按钮属性触发器的问题

button 按下取的是系统默认的颜色你想更改 需要把button的系统样式重写
2023-07-07 11:01:052

IPHONE的屏幕是什么类型的IPS

你好,想要音质好的音乐播放器当然要选酷狗和酷我音乐播放器了。酷狗播放器里面有很多免费的无损音乐可以下载。希望你能够喜欢。
2023-07-07 11:01:152

DBGrid相同数据合并成一个格[最好用Delphi回答]

能不能在通俗点得
2023-07-07 11:01:255

vb6 引用excel

你可以用低版本的office生成exe程序呀。
2023-07-07 11:02:073

WPF的DataGrid怎么实现多行表头

<Style x:Key="CityNumStyle" TargetType="DataGridColumnHeader"><Setter Property="Template"><Setter.Value><ControlTemplate><Grid x:Name="Root"><!--<Rectangle x:Name="BackgroundGradient" Fill="#eee" Stretch="Fill" Grid.ColumnSpan="2" />--><ContentPresenter Content="区号" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Center" /></Grid></ControlTemplate></Setter.Value></Setter></Style><Style x:Key="CityNameStyle" TargetType="DataGridColumnHeader"><Setter Property="Foreground" Value="#222" /><Setter Property="HorizontalContentAlignment" Value="Left" /><Setter Property="VerticalContentAlignment" Value="Center" /><Setter Property="IsTabStop" Value="False" /><Setter Property="SeparatorBrush" Value="#CCC" /><Setter Property="Padding" Value="8" /><Setter Property="Template"><Setter.Value><ControlTemplate><Grid x:Name="Root"><Grid.ColumnDefinitions><ColumnDefinition /><ColumnDefinition Width="auto" /></Grid.ColumnDefinitions><!--<Rectangle x:Name="BackgroundRectangle" Fill="#eee" Stretch="Fill" Grid.ColumnSpan="2" />--><Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"><Grid.RowDefinitions><RowDefinition Height="20" /><RowDefinition Height="1" /><RowDefinition Height="20" /></Grid.RowDefinitions><Grid.ColumnDefinitions><ColumnDefinition Width=
2023-07-07 11:02:252

液晶电视的IPS硬屏和软屏有什么区别

硬屏与软屏的简单区分 IPS (硬屏) IPS技术(In-Plane Switching,平面转换)是日立公司于2001推出的液晶屏技术,俗称“Super TFT”。IPS阵营以日立为首,聚拢了LGD、瀚宇彩晶等厂商。 此技术最大的特点是它的两极都在同一个面上,而不像其它液晶模式的电极是在上下两面,立体排列。由于电极在同一平面上,不管在何种状态下液晶分子始终都与屏幕平行,会使开口率降低,减少透光率,因此IPS应用在液晶电视上会需要更多的灯管,而在一定程度上,耗电量也会大些。 另一个缺点是漏光问题比较严重,黑色纯度不够,对比要比PVA稍差,因此必须依靠光学膜的补偿才能实现更好的黑色。 IPS屏的优点是可视角度高、向应速度快,色彩还原准确。和其它类型的屏相比,IPS屏的屏幕较为“硬”,用手轻轻划一下不容易出现水纹样变形,因此又有硬屏之称。 VA (软屏) 富士通的MVA技术(Multi-domain Vertical Alignment,多象限垂直配向技术) 可以说是最早出现的广视角液晶屏技术。该类屏可以提供更大的可视角度,通常可达到170°。改良后的P-MVA类屏可视角度可达178°,已接近目前消费者在家中观看的需求,向应时间亦可达到8ms以下。 三星Samsung电子的PVA技术(Patterned Vertical Alignment)同样属于VA技术的范畴,它是MVA技术的继承者和发展者,改良型的S-PVA已经可以和P-MVA并驾齐驱。PVA采用透明的ITO电极代替MVA中的液晶层凸起物,透明电极可以获得更好的开口率,最大限度减少背光源的浪费。 VA广视角技术,由于其强大的产能和稳定的质量控制体系,广泛应用于中高端液晶显示器或者液晶电视中。VA类屏属于软屏,用手轻轻划会出现类似的水纹。 屏幕的软硬,非选购取舍的唯一标准 目前,采用VA广视角技术的屏厂商有友达光电(AUO)、奇美电子(CMO)、中华映管(CPT)、三星及夏普;采用IPS技术的有IPS Alpha与LGD。 在同一场合,使用同一信号源,对比观看两款不同的液晶电视,如果画质有明显的差别,那么关键的问题应在液晶屏的等级与核心驱动的性能,而不在屏幕的软硬。因此,硬屏和软屏的合理解释,只在厂家的生产工艺特色,尽管各有不同,但也是万变不离其宗。 硬屏和软屏的物理性能都是一样的,只要不用重力撞击或用尖锐器物刻划,都不容易损伤。家电行业的专家认为,无论是硬屏还是软屏,都不可能决定液晶电视产品品质,也不应成为消费者选购取舍的唯一标准。 硬屏与软屏虽然在制作工艺上有一定的区别,但在性能上并没有绝对的优劣之分。前者漏光对比差,后者侧看色彩失真,然而硬屏与软屏厂商都已朝各自缺点逐步完善,世事无绝对,硬屏好、软屏差的谬论在信息流通的现代自然是不攻自破。硬屏透光性能与软屏在质量上没有明显区别,硬屏外加的保护膜不会造成透光不好,膜和屏幕粘合工艺要求也相当精良。而没有加保护外膜的软屏,只要消费者在使用时注意,不用重力撞击或用尖锐器物刻划,一般也不容易划伤
2023-07-07 11:02:364

C#怎样调用XAML绑定的数据?

能详细点么??具体的代码或者??
2023-07-07 11:02:443

wp /wpf 中 我想实现scrollviewer里面横向有三个控件,怎样实现滚动,下面也都是这个形式

ScrollViewer 给Width值指定一下,然后里边的内容的宽度也设置一下,当里边的宽度超过外边的宽度滚轮就有了,还有就是ScrollViewer里边VerticalScrollBarVisibility HorizontalScrollBarVisibility这两个属性设置一下,是横向和纵向滚轮显示的问题
2023-07-07 11:02:511

WPF—— Grid里怎么显示性别?

新建一个类实现System.Windows.Data.IValueConverter接口在接口方法Convert里,把object参数value转换成int,在把int对应的男或女的字符串return出去在绑定里应用那个新类转换器,语法是Text="{Binding RSex, Converter={StaticResource 你写的转换器}, Mode=OneWay}"
2023-07-07 11:02:571

WPF的DataGrid怎么实现多行表头

<Style x:Key="CityNumStyle" TargetType="DataGridColumnHeader"><Setter Property="Template"><Setter.Value><ControlTemplate><Grid x:Name="Root"><!--<Rectangle x:Name="BackgroundGradient" Fill="#eee" Stretch="Fill" Grid.ColumnSpan="2" />--><ContentPresenter Content="区号" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Center" /></Grid></ControlTemplate></Setter.Value></Setter></Style><Style x:Key="CityNameStyle" TargetType="DataGridColumnHeader"><Setter Property="Foreground" Value="#222" /><Setter Property="HorizontalContentAlignment" Value="Left" /><Setter Property="VerticalContentAlignment" Value="Center" /><Setter Property="IsTabStop" Value="False" /><Setter Property="SeparatorBrush" Value="#CCC" /><Setter Property="Padding" Value="8" /><Setter Property="Template"><Setter.Value><ControlTemplate><Grid x:Name="Root"><Grid.ColumnDefinitions><ColumnDefinition /><ColumnDefinition Width="auto" /></Grid.ColumnDefinitions><!--<Rectangle x:Name="BackgroundRectangle" Fill="#eee" Stretch="Fill" Grid.ColumnSpan="2" />--><Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"><Grid.RowDefinitions><RowDefinition Height="20" /><RowDefinition Height="1" /><RowDefinition Height="20" /></Grid.RowDefinitions><Grid.ColumnDefinitions><ColumnDefinition Width=
2023-07-07 11:03:041

delphi操作excel,如何定位已经命名的区域?

excel中可以选定一些单元格,然后为这个区域定义一个名称。现在已知一个excel文件,有多个sheet,这些sheet中有几个命名了的区域,这些命名域有几个,在哪里,什么名称事先都不知道。。。我要用delphi打开这个文件,用程序自动找出里面总共有几个命名域,并且一一定位进行赋值,要怎么实现,请高手帮忙~~
2023-07-07 11:03:225

wpf, datagrid最后空白列,消除方法

放在Viewbox里是可以的啊,我试过的。
2023-07-07 11:03:442

c#在word中插入表格!!wordDoc.Bookmarks.get_Item 集合所要求的成员不存在

你所谓的书签改了,具体的是书签的名字改了,还是书签内部的内容改了?改内容是不会影响书签名字的,肯定还得用原来的名来获取
2023-07-07 11:03:511

ScrollViewer如何动态添加控件

private void Window_Loaded(object sender, RoutedEventArgs e) { Grid g = new Grid(); g.HorizontalAlignment = HorizontalAlignment.Stretch; g.VerticalAlignment = VerticalAlignment.Stretch; g.Background = Brushes.Blue; ScrollViewer s = new ScrollViewer(); s.Width = 100; s.Height = 100; Label l = new Label(); l.Content = @"wpf 控件内 动态添加 控件";s.Content = l; this.AddChild(s); }
2023-07-07 11:04:101