Bitmapの事件簿

解決


全田一  2003-02-06 10:48:11  No: 2831

ビットマップで不思議な事件がおきています。

procedure TForm1.Button1Click(Sender: TObject);
     begin
          Bitmap := TBitmap.Create;
          Bitmap.Width := 12;
          Bitmap.Height := 304;
         
          ↓この場合はできる
           //Image2.Canvas.Brush.Color := RGB(255,255,255);    
          //Image2.Canvas.Rectangle(0,0,12,19);
          // Image2.Canvas.Brush.Color := RGB(255,255,204);
          //Image2.Canvas.Rectangle(0,19,12,38);
          // Image2.Canvas.Brush.Color := RGB(255,255,173);
          // Image2.Canvas.Rectangle(0,38,12,57);
         // Image2.Canvas.Brush.Color := RGB(255,255,153);
         // Image2.Canvas.Rectangle(0,57,12,76);
         // Image2.Canvas.Brush.Color := RGB(255,255,113);
         // Image2.Canvas.Rectangle(0,76,12,95);

         // Image2.Canvas.Brush.Color := RGB(255,255,93);
          //Image2.Canvas.Rectangle(0,95,12,114);

         // Image2.Canvas.Brush.Color := RGB(255,255,73);
         // Image2.Canvas.Rectangle(0,114,12,133);

         // Image2.Canvas.Brush.Color := RGB(255,255,53);
         // Image2.Canvas.Rectangle(0,133,12,152);

        //  Image2.Canvas.Brush.Color := RGB(102,0,0);
         //          Image2.Canvas.Rectangle(0,152,12,171);

         // Image2.Canvas.Brush.Color := RGB(92,0,0);
         // Image2.Canvas.Rectangle(0,171,12,190);

         // Image2.Canvas.Brush.Color := RGB(82,0,0);
         // Image2.Canvas.Rectangle(0,190,12,209);

         // Image2.Canvas.Brush.Color := RGB(72,0,0);
         // Image2.Canvas.Rectangle(0,209,12,228);

         // Image2.Canvas.Brush.Color := RGB(42,0,0);
         //           Image2.Canvas.Rectangle(0,228,12,247);

       //    Image2.Canvas.Brush.Color := RGB(31,0,0);
         //           Image2.Canvas.Rectangle(0,247,12,265);

        //   Image2.Canvas.Brush.Color := RGB(21,0,0);
         //           Image2.Canvas.Rectangle(0,265,12,284);

         //  Image2.Canvas.Brush.Color := clBlack;
          //          Image2.Canvas.Rectangle(0,284,12,303);
            ↓これだと無理
           Bitmap.Canvas.Pen.Width := 10;
           Bitmap.Canvas.Pen.Color := clBlack;
           Bitmap.Canvas.Brush.Color := RGB(255,255,255);

          Bitmap.Canvas.Rectangle(0,0,12,19);

          Bitmap.Canvas.Brush.Color := RGB(255,255,204);
          Bitmap.Canvas.Rectangle(0,19,12,38);

          Bitmap.Canvas.Brush.Color := RGB(255,255,173);
          Bitmap.Canvas.Rectangle(0,38,12,57);

          Bitmap.Canvas.Brush.Color := RGB(255,255,153);
          Bitmap.Canvas.Rectangle(0,57,12,76);

          Bitmap.Canvas.Brush.Color := RGB(255,255,113);
          Bitmap.Canvas.Rectangle(0,76,12,95);

          Bitmap.Canvas.Brush.Color := RGB(255,255,93);
          Bitmap.Canvas.Rectangle(0,95,12,114);

          Bitmap.Canvas.Brush.Color := RGB(255,255,73);
          Bitmap.Canvas.Rectangle(0,114,12,133);

          Bitmap.Canvas.Brush.Color := RGB(255,255,53);
          Bitmap.Canvas.Rectangle(0,133,12,152);

          Bitmap.Canvas.Brush.Color := RGB(102,0,0);
                   Bitmap.Canvas.Rectangle(0,152,12,171);

          Bitmap.Canvas.Brush.Color := RGB(92,0,0);
          Bitmap.Canvas.Rectangle(0,171,12,190);

          Bitmap.Canvas.Brush.Color := RGB(82,0,0);
          Bitmap.Canvas.Rectangle(0,190,12,209);

          Bitmap.Canvas.Brush.Color := RGB(72,0,0);
          Bitmap.Canvas.Rectangle(0,209,12,228);

          Bitmap.Canvas.Brush.Color := RGB(42,0,0);
                    Bitmap.Canvas.Rectangle(0,228,12,247);

           Bitmap.Canvas.Brush.Color := RGB(31,0,0);
                    Bitmap.Canvas.Rectangle(0,247,12,265);

           Bitmap.Canvas.Brush.Color := RGB(21,0,0);
                    Bitmap.Canvas.Ellipse(0,265,12,284);

           Bitmap.Canvas.Brush.Color := clBlack;
                    Bitmap.Canvas.Rectangle(0,284,12,303);
            Image2.Canvas.Draw(520,96,Bitmap);
            Canvas.Draw(520,96,Bitmap);
            Bitmap.Free;
            end;

Imageの場合はきちんと描かれruが、Bitmapの場合には描かれない・・・
これは密室トリックに違いない.
みんなで知恵を持ち合わせてこの謎を解いてみませんか?
じっちゃんの名にかけて!


耕介  2003-02-06 16:28:17  No: 2832

「ツジ」 アタシのぱそこんでは、どっちもチャンと描かれてけど… カゴちゃんの方は?
「カゴ」 アタシのぱそこんでも、どっちも同じに描かれてるもん。 もち Pen.Widthは、1 に変えたよ♪
「ソフ」 エ〜どうも(^^; 孫の一(はじめ)がオサワガセして…まことに申し訳ないことで…m(__)m
「ツジ」 ねぇねぇ〜、密室ってドコ? おじいちゃん。
「カゴ」 トリックって、にゃあ〜に? おじいちゃん。
「ソフ」 なんとも、お恥ずかしい限り…Image2の幅を広げればすぐ分かるのに(^^;;…なにせ孫はまだ未熟者で〜もう穴があれば入りたい(~_~;;…
「カゴ」 あれ?ツジちゃんナニしてんの?
「ツジ」 ケーキに穴あけてるの♪


たかみちえ  URL  2003-02-06 17:21:04  No: 2833

Bitmap内には本当に書かれていないでしょうか?
Canvasの関数はあんまり知りませんけど、見た限り問題なさそうな気がします。
  まず、Bitmap.SaveToFile()で適当な場所に保存し、本当に何にも入っていないのか、
確認してみたほうがいいです。
  見た感じDrawがなんか変な気がしますから。

  というわけでトリックではなさそうです(^^ゞ


全田一  2003-02-07 10:54:04  No: 2834

じっちゃん、たかみちえさん、オラやったぞ!
Bitmapでファイル保存までできた!
Imageはもとから必要なかったんだな!オラやっとわかっただ!
地球のみんながオラに元気を分けてくれたおかげだっ!
次の天下一武道会では優勝ねらっちゃうぞ!
待ってろピッコロ!


※返信する前に利用規約をご確認ください。

※Google reCAPTCHA認証からCloudflare Turnstile認証へ変更しました。






  このエントリーをはてなブックマークに追加