Re: Drawing on TBitmaps canvas always shows white? - Part 2
From: Michael Trojanek (tro_at_adv.magwien.gv.at)
Date: 04/16/04
- Next message: Maarten Wiltink: "Re: Store a BMP in a XML Node ?"
- Previous message: Jeremy Collins: "Re: Moving cursor between declaration and implementation in the IDE"
- In reply to: GodDamnit: "Re: Drawing on TBitmaps canvas always shows white? - Part 2"
- Next in thread: GodDamnit: "Re: Drawing on TBitmaps canvas always shows white? - Part 2"
- Reply: GodDamnit: "Re: Drawing on TBitmaps canvas always shows white? - Part 2"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 16 Apr 2004 14:17:02 +0200
long time since i did something like that, but in my opinion
mybitmap.canvas.pixels[x, y] := clRed;
should work.
If you want to draw a rectangle, maybe set the canvas.brush.color
accordingly, since pen.color only affects the border. just a thought ...
kind regards ...
.mitro
"GodDamnit" <nospam@askforemail.com> schrieb im Newsbeitrag
news:407fc36b$0$11588$65c69314@mercury.nildram.net...
> Hmm, still playing around with it, it seems that if I change one of the
> lines to:
>
> mybitmap.canvas.pen.color := clRed;
>
> Instead of:
>
> mybitmap.canvas.pen.color := mypixarray[i, j];
>
> It still displays white. I'm wondering if I have to, in some way, specify
> the bitmap's palette?
>
> Again, thanks for any help.
>
> -GD
>
>
>
> "GodDamnit" <nospam@askforemail.com> wrote in message
> news:407fbe5c$0$95316$65c69314@mercury.nildram.net...
> > Hi, I'm having problems with some bitmaps. I have an array of pixels
which
> I
> > use to make small modifications to an image in my program, defined as:
> >
> > var mypixarray : Array[0..512, 0..512] of TColor;
> >
> > I did this as the canvas's 'Pixels' property appears to be read-only.
The
> > problem I have is when I want to draw these pixels on the canvas. At the
> > moment I have a system which doesnt complain (no errors), but doesnt
work
> > right either, I do it using the following (rather slopping, I know)
code:
> >
> > for j := 0 to 512 do
> > for i := 0 to 512 do
> > begin
> > mybitmap.canvas.pen.color := mypixarray[i, j];
> > mybitmap.canvas.Rectangle(i, j, i+1, j+1);
> > end;
> >
> > The problem is that when I come to assign 'mybitmap' to a TImage on my
> form,
> > it just shows white, even when I specifically fill the array with
> different
> > colours. Does anyone know a fix for this? Also, if anyone could suggest
a
> > better way of transferring the pixel array to the canvas, I would be
most
> > grateful, the Delphi help file mentions a DrawPoint function in TCanvas,
> but
> > it doesnt seem to exist, an oversight in the documentation?
> >
> > Thanks in advance.
> >
> > -GD
> >
> >
>
>
- Next message: Maarten Wiltink: "Re: Store a BMP in a XML Node ?"
- Previous message: Jeremy Collins: "Re: Moving cursor between declaration and implementation in the IDE"
- In reply to: GodDamnit: "Re: Drawing on TBitmaps canvas always shows white? - Part 2"
- Next in thread: GodDamnit: "Re: Drawing on TBitmaps canvas always shows white? - Part 2"
- Reply: GodDamnit: "Re: Drawing on TBitmaps canvas always shows white? - Part 2"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|