Results 1 to 5 of 5

Thread: how can I save a modified Pic.Pset to a .BMP file ?

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2000
    Location
    Taiwan
    Posts
    2

    Question

    hi, everybody:

    How can I save a modified Pic.Pset to a .BMP file ?

    below is my source code,I get RGB color from
    Picture1 and add 10 to the RGB value,then Pset Picture2.
    Then I use SavePicture to get modifid Picture2.image saved.
    But I can not get the modified Picture2 saved. Why?


    Note: the picture1 is 256 gray scale in 277*221

    Private Sub Command1_Click()

    For X3 = 0 To 276
    For Y3 = 0 To 220
    gray_scale0 = "&H" + Mid$(Hex$(Picture1.Point(X3, y3)),1, 1)
    gray_scale1 = "&H" + Mid$(Hex$(Picture1.Point(X3, Y3)), 2, 1)
    R_color = Val(gray_scale0) * 16 + Val(gray_scale1)+10
    Picture2.PSet (X3, Y3), RGB(R_color, R_color, R_color)
    Next
    Next

    pic_name = "tst.bmp"

    Call SavePicture(Picture2.Image, pic_name)

    End Sub

    [Edited by vov on 04-17-2000 at 07:30 AM]

  2. #2
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    Try Changing the pictureboxes autoredraw property, I think it needs to be set to true.

  3. #3
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Thumbs up

    put the image property to the picture property and save the picture property
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  4. #4

    Thread Starter
    New Member
    Join Date
    Apr 2000
    Location
    Taiwan
    Posts
    2
    I have tried the Picture2.AutoRedraw = True or Picture2.Picture = Picture2.Image. And save Picture2.Picture. But that
    still doesn't wrok. It just save a PIC filled with background color. Where do I put the AutoRedraw?

    Thanks a lot.

  5. #5
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Well set the autoredraw in design mode and use object.refresh to update the control you're drawing to.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width