Can only modify an image if it contains a bitmap

Image1装载了JPG文件后下面都报错,因为。

Image1.Canvas.CopyRect(drect,Image1.Canvas,srect);

Image1.Picture.Bitmap.Canvas.CopyRect(drect,Image1.Canvas,srect);

以上2行都报错。只是在image1的picture为bmp的时候适用。

Image1.Canvas.MoveTo(1,1);
Image1.Canvas.LineTo(100,100);

这样也报错,但是未装载jpg文件或者装载的bmp文件就不报错了。

如果Image1.Picture.Graphic不是TBitmap,Image1.Canvas是不可使用的。

procedure TForm1.Button1Click(Sender: TObject);
var
MyRgn: HRGN;
begin
MyRgn := CreateRectRgn(,,,);
SelectClipRgn(Image1.Canvas.Handle,MyRgn);
Image1.Canvas.Brush.Color := clRed;
Image1.Canvas.FillRect(Image1.Canvas.ClipRect);
Image1.Invalidate;
SelectClipRgn(Image1.Canvas.Handle, HRGN(nil));
DeleteObject(MyRgn);
end;
    Image1.Canvas.Brush.Color := clRed;
Image1.Canvas.Brush.Style := bsDiagCross;
Image1.Canvas.Ellipse(, , Image1.Width, Image1.Height);

Can only modify an image if it contains a bitmap的更多相关文章

  1. AutoMapper:Unmapped members were found. Review the types and members below. Add a custom mapping expression, ignore, add a custom resolver, or modify the source/destination type

    异常处理汇总-后端系列 http://www.cnblogs.com/dunitian/p/4523006.html 应用场景:ViewModel==>Mode映射的时候出错 AutoMappe ...

  2. Modify Branding of FreeCAD

    Modify Branding of FreeCAD eryar@163.com This article describes the Branding of FreeCAD. Branding me ...

  3. -bash: ulimit: pipe size: cannot modify limit: Invalid argument

    从root账号切换到oracle账号时,出现了"-bash: ulimit: pipe size: cannot modify limit: Invalid argument"提示 ...

  4. Cannot send session cache limiter Cannot modify header information

    当php报出  Cannot send session cache limiter 或Cannot modify header information   的错误时   其理论上是因为php代码以前有 ...

  5. (error) MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about t

    运行redis过程中,突然报错如下: (error) MISCONF Redis is configured to save RDB snapshots, but is currently not a ...

  6. 阿里云服务器出现Warning: Cannot modify header information - headers already sent by (output started at 问题的解决方法

    阿里云服务器出现Warning: Cannot modify header information - headers already sent by (output started at 问题的解决 ...

  7. Modify a Stored Procedure using SQL Server Management Studio

    In Object Explorer, connect to an instance of Database Engine and then expand that instance. Expand  ...

  8. Modify textures at runtime

    动态修改Texture Modify textures at runtime?http://answers.unity3d.com/questions/7906/modify-textures-at- ...

  9. (HY000): Cannot modify @@session.sql_log_bin inside a transaction

    昨天,线上发生一例(HY000): Cannot modify @@session.sql_log_bin inside a transaction代码缺少显示的start transaction控制 ...

随机推荐

  1. bzoj 2002 Bounce 弹飞绵羊

    bzoj 2002 Bounce 弹飞绵羊 设一个虚拟节点表示被弹飞,则每个点的后继点是唯一确定的,每个点向它的后继点连边,就形成了一颗树. 询问就是问某个节点到虚拟节点的路径长度,修改就删除原来向后 ...

  2. hive表数据导出到csv乱码原因及解决方案

    转载自http://blog.csdn.net/lgdlxc/article/details/42126225 Hive表中的数据使用hive - e"select * from table ...

  3. eclipse 无用代码扫描工具UCDetector

    本文主要介绍UCDetector(无用代码扫描工具)使用方法及局限 对于沉积或多方接手开发的项目经常会遇到一坨一坨无用的代码,但一个一个类查找又相当费时,这里介绍一个eclipse插件扫描没有引用的类 ...

  4. bad ELF interpreter

    安装JDK的时候遇到的问题,  多半是64位的系统安装了32位的软件导致的

  5. java 并发synchronized使用

    从版本1.0开始,java中每个对象都有一个内部锁,如果一个方法用synchronized修饰,那么对象的锁将保护整个方法,也就是说要调用该方法,线程必须获得内部的对象锁 换句话说 public sy ...

  6. ArangoDB Foxx service 使用

    备注:   项目使用的是github https://github.com/arangodb-foxx/demo-hello-foxx 1. git clone git clone https://g ...

  7. unity导入3dsMax源文件.max

    https://blog.csdn.net/qq_28002559/article/details/53693621 首先unity导入3dsMax文件为什么要使用.max而不用.fbx,因为我不是做 ...

  8. centos vi显示中文

    1. 控制台终端显示中文 修改 /etc/sysconfig/i18n 文件如下: #LANG="en_US.UTF-8"LANG="zh_CN.GB2312" ...

  9. jeecg中一对多的关系映射

    1.首先看一张前端页面: 有一张主表和3张子表,显示这3张子表的代码如下 <t:tabs id="tt" iframe="false" tabPositi ...

  10. [Java.Web][Servlet]常用请求头

    response.setStatus(302); response.setHeader("location", "/day04/1.html"); 这段代码可以 ...