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
 Converting to 8bit

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
haya Posted - Feb 26 2020 : 08:01:59
I need to get screenshot, convert it to 8bit bitmap and save to TMemoryStream. so i wrote this code but get Access Violation error. What's wrong?:

var Stream:= TMemoryStream.Create;
ImageEnIO.CaptureFromScreen(iecsScreen, crNone);
ImageEnIO.IEBitmap.PixelFormat := ie8g;
ImageEnIO.SaveToStreamBmp(Stream);
Stream.Position:= 0;
img1.Picture.LoadFromStream(Stream);
2   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Aug 05 2020 : 20:21:37
Hi

FYI, in 9.1.2 you can automatically handle this by calling:

IEGlobalSettings().AutoSetBitDepth := True;

Nigel
Xequte Software
www.imageen.com
xequte Posted - Feb 26 2020 : 17:49:18
Hi

Please also set the BitsPerSample and SamplesPerPixel appropriately:

Stream := TMemoryStream.Create;
ImageEnView1.IO.CaptureFromScreen(iecsScreen, crNone);
ImageEnView1.IO.IEBitmap.PixelFormat := ie8g;
ImageEnView1.IO.Params.BitsPerSample := 8;
ImageEnView1.IO.Params.SamplesPerPixel := 1;
ImageEnView1.IO.SaveToStreamBmp(Stream);
Stream.Position:= 0;
image1.Picture.LoadFromStream(Stream);
Stream.Free;


Nigel
Xequte Software
www.imageen.com