怎样生成不带ALPHA通道的BMP位图文件?(100分)

  • 主题发起人 主题发起人 zgp2000
  • 开始时间 开始时间
Z

zgp2000

Unregistered / Unconfirmed
GUEST, unregistred user!
我用下面代码生成的BMP文件在PHOTOSHOP中打开总是有ALPHA通道,我希望生成的是没有ALPHA通道的位图,怎么处理?下面是我的代码。



image1.Canvas.Brush.Color := myinifile.ReadInteger('szsjzm','Bjcolor',Color);
image1.Canvas.FillRect(Rect(0, 0, 720, 575));
image1.Canvas.Brush.Color := myinifile.ReadInteger('szsjzm','Bjcolor',Color);
image1.Canvas.Font.Name :=myinifile.ReadString('szsjzm',MFontName,Font.Name);
MStylespoint:=@a;
image1.Canvas.Font.style := TFontStyles(MStylespoint^);
image1.Canvas.Font.Size := myinifile.ReadInteger('szsjzm',MFontSize,Font.Size);
image1.Canvas.Font.Color := myinifile.ReadInteger('szsjzm',MFontColor,Font.Color);

Image1.Picture.SaveToFile(ExtractFilePath(paramstr(0))+'PICT/ZM_'+TreeView1.Selected.Text+'.bmp');
 
换一个提问方式,我现在保存的bmp文件默认是32位的,如果是24位的就可以了。
但是image1控件生成的都是24位的,如果24位就没有alpha通道。
 
//这里加入
temp: tbitmap;
temp := tbitmap.create;
temp.assign(image1.picture.graphic);
temp.pixelformat := pf24bit;
temp.savetofile(ExtractFilePath(paramstr(0))+'PICT/ZM_'+TreeView1.Selected.Text+'.bmp');
temp.free;
 
PixelFormat:=pf24bit
 
接受答案了.
 
后退
顶部