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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Create a white TIEBitmap and draw rectangles on it

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
PeterPanino Posted - Dec 09 2016 : 17:51:51
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?
3   L A T E S T    R E P L I E S    (Newest First)
w2m Posted - Dec 10 2016 : 10:21:24
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
w2m Posted - Dec 10 2016 : 10:01:13
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
PeterPanino Posted - Dec 09 2016 : 19:04:33
Even CopyFromTBitmap does not work:

MyTIEBitmap.CopyFromTBitmap(ATBitmap);