XE10.2 在Button1 中處理 Png 後再 OnPaint 貼圖,PNG 透明未理到,但在 XE10.1 是對的 |
尚未結案
|
etjon
一般會員 發表:14 回覆:12 積分:5 註冊:2002-03-12 發送簡訊給我 |
(1). 如果處理 png 的程式碼寫在 Button1Click and OnPaint Draw ,Android PNG 貼圖時會看到它沒有處理到透明 XE10.2 有問題,但 XE10.1 是對的
void __fastcall TForm2::Button1Click(TObject *Sender) { TImage *p = new TImage(NULL); p->Bitmap->SetSize(m_ScreenPoint.x,m_ScreenPoint.y); // Windows is OK ,But Android is Failed p->Bitmap->Canvas->BeginScene(); p->Bitmap->Canvas->Clear(claWhite); p->Bitmap->Canvas->DrawBitmap( bkimg->Bitmap,RectF(0, 0,bkimg->Bitmap->Width,bkimg->Bitmap->Height),RectF(0, 0,m_ScreenPoint.X,m_ScreenPoint.Y),1, true); p->Bitmap->Canvas->DrawBitmap( i2->Bitmap,RectF(0, 0,i2->Bitmap->Width,i2->Bitmap->Height),RectF(10,250,10 i2->Bitmap->Width,250 i2->Bitmap->Height),1, true); p->Bitmap->Canvas->EndScene(); p->Bitmap->Canvas->BeginScene(); m_ScreenImage->Bitmap->Canvas->BeginScene(); m_ScreenImage->Bitmap->Assign(p->Bitmap); m_ScreenImage->Bitmap->Canvas->EndScene(); delete p ; InvalidateRect(RectF(0, 0,m_ScreenPoint.X,m_ScreenPoint.Y)); } void __fastcall TForm2::FormPaint(TObject *Sender, TCanvas *Canvas, const TRectF &ARect) { Canvas->DrawBitmap(m_ScreenImage->Bitmap,TRectF(0,0,m_ScreenImage->Bitmap->Width,m_ScreenImage->Bitmap->Height), TRectF(0,0,m_ScreenPoint.X,m_ScreenPoint.Y),1); } //------------------------------------------------------------------------------------------------------------ This Code windows and Android is OK void __fastcall TForm2::FormPaint(TObject *Sender, TCanvas *Canvas, const TRectF &ARect) { TImage *p = new TImage(NULL); p->Bitmap->SetSize(m_ScreenPoint.x,m_ScreenPoint.y); // Windows And Android is OK Android p->Bitmap->Canvas->Clear(claWhite); p->Bitmap->Canvas->DrawBitmap( bkimg->Bitmap,RectF(0, 0,bkimg->Bitmap->Width,bkimg->Bitmap->Height),RectF(0, 0,m_ScreenPoint.X,m_ScreenPoint.Y),1, true); p->Bitmap->Canvas->DrawBitmap( i2->Bitmap,RectF(0, 0,i2->Bitmap->Width,i2->Bitmap->Height),RectF(10,250,10 i2->Bitmap->Width,250 i2->Bitmap->Height),1, true); m_ScreenImage->Bitmap->Assign(p->Bitmap); delete p ; Canvas->DrawBitmap(m_ScreenImage->Bitmap,TRectF(0,0,m_ScreenImage->Bitmap->Width,m_ScreenImage->Bitmap->Height), TRectF(0,0,m_ScreenPoint.X,m_ScreenPoint.Y),1); } |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |