我的程序是这样的的
procedure TForm1.Open1Click(Sender: TObject);
begin
// 打开OpenDialog对话框,打开图形文件加载画布上(Image1)
if OpenDialog1.Execute then
begin
CurrentFile := OpenDialog1.FileName;
Image.Picture.LoadFromFile(CurrentFile);
image.Canvas.
end;
end;
//在图片上写入文字
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
image.Canvas.Font.Style:= [fsBold];
image.Canvas.Font.Size:=15;
image.Canvas.TextOut(strtoint(edit2.Text),strtoint(edit3.Text),edit4.Text);
end;
然后我想保存并转换成jpg的图像,应该怎么做呢
procedure TForm1.Open1Click(Sender: TObject);
begin
// 打开OpenDialog对话框,打开图形文件加载画布上(Image1)
if OpenDialog1.Execute then
begin
CurrentFile := OpenDialog1.FileName;
Image.Picture.LoadFromFile(CurrentFile);
image.Canvas.
end;
end;
//在图片上写入文字
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
image.Canvas.Font.Style:= [fsBold];
image.Canvas.Font.Size:=15;
image.Canvas.TextOut(strtoint(edit2.Text),strtoint(edit3.Text),edit4.Text);
end;
然后我想保存并转换成jpg的图像,应该怎么做呢
解决方案 »
- 查询效率问题
- 子窗体如何设置障碍
- 高分寻找触摸屏相关的开发资料
- 这种情况如何回收堆空间
- 如何在DBGrid最后一条记录后插入一行空行!!高分求救世主100。
- 请问用代码怎么实现将程序快捷方式加到系统右键菜单中?
- 有谁可以告诉我在DELPHI里怎样实现将一个文件复制到指定的位置上呢?
- 莫名其妙之乱扣信誉分
- 我的菜单图标,想要鼠标放进去颜色就改变,可是老出现黑点?
- delphi语句的写法.....
- 我有个TXT文件,里面有按顺序排列的一些数据(排列的方式例如十字、五角星,数据是由图片的像数点组成的即RGB(255)),我现在要想把另一张图片按TXT里的排列方式提取出图片的RGB,要怎么提取!
- 怎么把字符串转换为JPG格式的图片.
Jpeg;procedure .......;
var
jpg: TJpegImage;
begin
jpg := TJpegImage.Create;
jpg.Width := image.Picture.Width;
jpg.Height := image.Picture.Height;
jpg.Assign(image.Picture.Bitmap);
jpg.SaveToFile('c:\temp.jpg');
jpg.Free;
end;如果你打开的是元文件或图标,则不行。
Use Bitmap to reference the picture object when it contains a bitmap. If Bitmap is referenced when the picture contains a Metafile or Icon graphic, the graphic won't be converted. Instead, the original contents of the picture are discarded and Bitmap returns a new, blank bitmap.
uses
Graphics,
Jpeg;procedure BMP2JPG(const BMPFile: string);
var
BMP: TBitmap;
JPG: TJpegImage;
FileName: string;
begin
FileName := BMPFile; BMP := TBitmap.Create;
JPG := TJpegImage.Create; try
BMP.LoadFromFile(FileName);
JPG.Assign(BMP);
FileName := ChangeFileExt(FileName, '.jpg');
JPG.SaveToFile(FileName);
finally
BMP.Free;
JPG.Free;
end;
end;procedure JPG2BMP(const JPGFile: string);
var
BMP: TBitmap;
JPG: TJpegImage;
FileName: string;
begin
FileName := JPGFile; BMP := TBitmap.Create;
JPG := TJpegImage.Create; try
JPG.LoadFromFile(FileName);
BMP.Assign(JPG);
FileName := ChangeFileExt(FileName, '.bmp');
BMP.SaveToFile(FileName);
finally
BMP.Free;
JPG.Free;
end;
end;
"DELPHI bmp转jpg"就有了!!