ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Create a white TIEBitmap and draw rectangles on it
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PeterPanino

933 Posts

Posted - Dec 09 2016 :  17:51:51  Show Profile  Reply
Previously I could do this with TBitmap which worked fine:

var
  MyBitmap: TBitmap;
  MyRect: TRect;
..

MyBitmap := TBitmap.Create;
MyBitmap.Width := 500;
MyBitmap.Height := 500;
MyBitmap.Canvas.Brush.Style := bsSolid;
MyBitmap.Canvas.Brush.Color := clRed;
MyBitmap.Canvas.FillRect(MyRect);


This does not work anymore with TIEBitmap.

How can I do the same with TIEBitmap?

How can I create a WHITE TIEBitmap and draw some colored rectangles on it?

PeterPanino

933 Posts

Posted - Dec 09 2016 :  19:04:33  Show Profile  Reply
Even CopyFromTBitmap does not work:

MyTIEBitmap.CopyFromTBitmap(ATBitmap);
Go to Top of Page

w2m

USA
1990 Posts

Posted - Dec 10 2016 :  10:01:13  Show Profile  Reply
procedure TForm1.Button2Click(Sender: TObject);
var
  iIEBitmap: TIEBitmap;
  iIEBitmap2: TIEBitmap;
  iRect: TRect;
begin
  try
    iRect := Rect(0, 0, 250, 250);
    iIEBitmap := TIEBitmap.Create;
    iIEBitmap.Allocate(500, 500);
    iIEBitmap.Canvas.Brush.Style := bsSolid;
    iIEBitmap.Canvas.Brush.Color := clRed;
    iIEBitmap.Canvas.FillRect(iRect);
    try
      iIEBitmap2 := TIEBitmap.Create(iIEBitmap);
      ImageEnView1.IEBitmap.Assign(iIEBitmap2);
      ImageEnView1.Update;
    finally
      iIEBitmap2.Free;
    end;
  finally
    iIEBitmap.Free;
  end;
end;

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

w2m

USA
1990 Posts

Posted - Dec 10 2016 :  10:21:24  Show Profile  Reply
How can I create a WHITE TIEBitmap and draw some colored rectangles on it?

procedure TForm1.Button2Click(Sender: TObject);
var
  iIEBitmap: TIEBitmap;
  iIEBitmap2: TIEBitmap;
  iRect: TRect;
begin
  try
    {Create a white 500x500 IEBitmap}
    iIEBitmap := TIEBitmap.Create;
    iIEBitmap.Allocate(500, 500);
    iIEBitmap.Fill(clWhite);
    {Create a red rect }
    iRect := Rect(0, 0, 250, 250);
    iIEBitmap.Canvas.Brush.Style := bsSolid;
    iIEBitmap.Canvas.Brush.Color := clRed;
    iIEBitmap.Canvas.FillRect(iRect);
    {Create a green rect }
    iRect := Rect(50, 275, 275, 250);
    iIEBitmap.Canvas.Brush.Style := bsSolid;
    iIEBitmap.Canvas.Brush.Color := clGreen;
    iIEBitmap.Canvas.FillRect(iRect);
    {Create a blue rect }
    iRect := Rect(300, 300, 350, 350);
    iIEBitmap.Canvas.Brush.Style := bsSolid;
    iIEBitmap.Canvas.Brush.Color := clBlue;
    iIEBitmap.Canvas.FillRect(iRect);
    try
      iIEBitmap2 := TIEBitmap.Create(iIEBitmap);
      ImageEnView1.IEBitmap.Assign(iIEBitmap2);
      ImageEnView1.Update;
    finally
      iIEBitmap2.Free;
    end;
  finally
    iIEBitmap.Free;
  end;
end;

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: