作成した新しいビットマップイメージを表示したいと考えています。それを保存しないでください。新しいビットマップを保存しないC#
私は新しいイメージを保存せずに新しいイメージを返すことを望んでいるC#およびimのグラフィックスでビットマップを使用しています。
C#
private void GenerateBanner(string titleText) {
Bitmap bannerSource = new Bitmap(DefaultBannerPath);
//bannerSource.Save(PhysicalBannerPath);
RectangleF rectf = new RectangleF(430, 50, 650, 50);
using (Graphics g = Graphics.FromImage(bannerSource))
{
g.SmoothingMode = SmoothingMode.AntiAlias;
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
g.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;
g.DrawString(titleText, new Font("Bradley Hand ITC", 100, FontStyle.Bold), Brushes.White, rectf);
//bannerSource.Save(PhysicalBannerPath);
}
}
Winforms? 'Form'に' PictureBox'を使用してください –
あなたはWinFormsやWPFを使っているのですか? – Fredrik
私自身のクラスコントロール。それはaspxのページになります。 @FredrikRedin –