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. 每天一个linux命令(文件操作):【转载】locate命令

    locate 让使用者可以很快速的搜寻档案系统内是否有指定的档案.其方法是先建立一个包括系统内所有档案名称及路径的数据库,之后当寻找时就只需查询这个数据库,而不必实际深入档案系统之中了.在一般的 di ...

  2. 《DSP using MATLAB》示例9.3

    增采样操作是时变的.

  3. 关于fpga优化的set input delay 和 set output delay

    set input delay 和set output delay 首先必须明确的是指的外部delay,而非input或output的内部delay,那么这外部delay包含什么呢?包含1,外部路径延 ...

  4. ft,dtft,dft的关系(转载)

    很多同学学习了数字信号处理之后,被里面的几个名词搞的晕头转向,比如DFT,DTFT,DFS,FFT,FT,FS等,FT和FS属于信号与系统课程的内容,是对连续时间信号的处理,这里就不过多讨论,只解释一 ...

  5. c# String.Split数组省去空字符

    public static void test() { string txt = "hi[#b1.jpg][#b4.jpg]few[#b1-3.jpg]"; txt = " ...

  6. 如何在项目中使用requireJS

    本文主要讲讲如何在一个项目中合理的使用requireJS,来加载js代码,这里是个实际例子,讲解不多, 看详情请连接到:http://www.cnblogs.com/evaling/p/6722760 ...

  7. Unit07: 状态管理-Session

    Unit07: 状态管理-Session web package web; import java.io.IOException; import java.io.PrintWriter; import ...

  8. supervisor备忘

    supervisor是把普通app变成deamon的工具,虽然没有erlang的supervise粒度那么细,但是已经非常方便了 安装 sudo apt-get install supervisor ...

  9. GOF23设计模式之访问者模式(visitor)

    一.访问者模式概述 (1)模式动机   对于存储在一个集合中的对象,他们可能具有不同的类型(即使有一个公共的接口),对于该集合中的对象,可以接受一类称为访问者的对象来访问,不同的访问者其访问方式也有所 ...

  10. mybatis实现继承映射

    ORM 框架的优势在于能让我们利用面向对象的思维去操作数据库, hibernate 作为重量级的 ORM 框架对面向对象的支持很强大.作为半自动化的 mybatis ,对面向对象的支持也是很完备的.这 ...