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
 acces to ieuimage

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
klausdoege Posted - Sep 12 2012 : 03:41:07
Hello,
how can I access individual pixels of ieuimage ?

Klaus
www.klausdoege.de
9   L A T E S T    R E P L I E S    (Newest First)
klausdoege Posted - Sep 14 2012 : 07:06:47
William,
yes exactly that mean I.
Bad luck that not on the undoimage can be grabbed.
Redo brings back everything, I would not like that in this case.
Nevertheless thank you for your effort

Klaus
www.klausdoege.de
xequte Posted - Sep 13 2012 : 13:53:40
Hi

When you call ImageEnView.Proc.SaveUndoCaptioned('Contrasted', ieuImage), the original state of the image is saved to an internal object, which cannot be accessed externally, other than by calling Redo.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
w2m Posted - Sep 13 2012 : 10:31:04
Sorry Klaus, I still do not understand this. You load a file, save undo, blur the image, then paint on the image, then negative the image... then what? Do you want to reset the color of pixels 10 to 100? There is no such thing as ieuimage which has me confused...

oh... maybe you want to restore colors from part of the undoimage?

If that is the case I do not think it is possible with undo. Your best approach may be to create a TIEBitmap, copy the original image.IEBitmap to the TIEBitmap and then change the colors by accessing the temporary TIEBitmap?

var
iIEBitmap: TIEBitmap;
i: integer;
begin
  iIEBitmap := TIEBitmap.Create;
  try  
    ImageEnView.IO.loadfromfile('cccc.xx');
    // Copy the image to iIEBitmap 
    iIEBitmap.Assign(ImageEnView.IEBitmap);
    // Blur the image
    ImageEnView.Proc.Blur(2.5); 
    ...Paint on the image
    // Apply a negative filter
    ImageEnview.Proc.Negative;
    // Copy the pixel colors from iIEBitmap (the original image) to 
    // ImageEnView.IEBitmap
    for i := 10 to 100 do 
     ImageEnView.IEBitmap.pixels[i,100] := iIEBitmap.pixels[i,100]; 
    ImageEnView.Update;
  finally
    iIEBitmap.Free;
   end;
end;

end;


William Miller
klausdoege Posted - Sep 13 2012 : 08:43:07
William,

1. ImageEnView.IO.loadfromfile('cccc.xx')
2. ImageEnView.Proc.SaveUndoCaptioned(ieuimage)
3. ImageEnView.proc.blur(2.5);
4. I Paint on the image every what
5. Imageenview.pro.negative
.
.
But now, I would like to put back some pixel-areas again however.
An example would be:
for x:=10 to 100 do
ImageEnView.iebitmap.pixels[x,100] := Imagenview.ieuimage.pixels[x,100];
But the command Imagenview.ieuimage.pixels[x,100]; is not existing.
How I can realize this.

Klaus
www.klausdoege.de
w2m Posted - Sep 13 2012 : 06:22:47
Klaus,

I do not understand what you are trying to tell me.


William Miller
klausdoege Posted - Sep 13 2012 : 04:24:28
Hello William,
thank you for the detailed examples.
But it is already clear to me as I alter the colors in the current picture.
But I would like to access the image stored with ImageEnView.Proc.SaveUndoCaptioned(ieuimage),
the old color-value from the Undo image reads.
I hope understands something I mean.

Klaus
www.klausdoege.de
w2m Posted - Sep 12 2012 : 17:15:11
Get the pixel colors and alpha values:

procedure TFormMain.ImageEnViewMouseMove(Sender: TObject; Shift: TShiftState; X, Y: integer);
begin
  iBX := ImageEnView.XScr2Bmp(X);
  iBY := ImageEnView.YScr2Bmp(Y);
  // Show current color and alpha values
  CurrentPenColor1.Color := ImageEnView.IEBitmap.Canvas.Pixels[iBX, iBY]
  CurrentBrushColor1.Color := ImageEnView.IEBitmap.AlphaChannel.Canvas.Pixels[iBX, iBY];
LabelAlpha1.Caption := 'Alpha: ' + IntToStr(ImageEnView.IEBitmap.Alpha[iBX, iBY]);
end;


Set the pixel colors and alpha values:

procedure TFormMain.ImageEnViewMouseMove(Sender: TObject; Shift: TShiftState; X, Y: integer);
begin
  iBX := ImageEnView.XScr2Bmp(X);
  iBY := ImageEnView.YScr2Bmp(Y);
 iPenTransparency := PenAlpha1.EditValue;
 iBrushTransparency := BrushAlpha1.EditValue;
 if (DrawButton.Down) and ImageEnView.MouseCapture then 
 // Paint color and alpha
 begin
   ImageEnView.Proc.SaveUndoCaptioned('PaintPen ' + IntToStr(ImageEnView.Proc.UndoCount + 1));
    Undo1.Hint := 'Paint Pen ' + IntToStr(ImageEnView.Proc.UndoCount + 1);
    iPoint.X := ImageEnView.XScr2Bmp(X);
    iPoint.Y := ImageEnView.YScr2Bmp(Y);
    ImageEnView.HighlightedPixel := iPoint;
    ImageEnView.IEBitmap.Canvas.Pixels[iBX, iBY] := dxPenColorGallery1.ColorValue;
    ImageEnView.IEBitmap.AlphaChannel.Canvas.Pen.Color := $02000000 or (iPenTransparency) or (iPenTransparency shl 8)
              or (iPenTransparency shl 16);
    ImageEnView.IEBitmap.AlphaChannel.Canvas.Brush.Color := $02000000 or (iBrushTransparency) or (iBrushTransparency shl 8) or (iBrushTransparency shl 16);
    ImageEnView.IEBitmap.AlphaChannel.Canvas.Pixels[iBX, iBY] := dxPenColorGallery1.ColorValue;
    ImageEnView.IEBitmap.Alpha[iBX, iBY] := iBrushTransparency;
    ImageEnView.Bitmap.Modified := True;
    ImageEnView.Update;
end;
end;


TIP: Look the the source code in the simple GDIPLus demo that shipped with my EBook.... or in the ImageEnViewDrawBackBuffer demo shipped with my EBook or my Icon editor in samples.
William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
klausdoege Posted - Sep 12 2012 : 14:20:28
I will read the pixelcolor, but ieuimage.scanline is not available
could you make a Example

Klaus
www.klausdoege.de
w2m Posted - Sep 12 2012 : 05:12:59
What do you mean access he pixels? Change a pixels color or transparency? Use scanline for some procedure?

William Miller